ml.postprocessing.darknet — Darknet
The ml.postprocessing.darknet module contains post-processors for Darknet
based object detection models.
class YoloV2 – YOLO V2
Post-processor for YOLO V2 model outputs.
- class ml.postprocessing.darknet.YoloV2(threshold: float = 0.6, anchors: numpy.ndarray = None, nms_threshold: float = 0.1, nms_sigma: float = 0.1)
Create a YOLO V2 postprocessor.
thresholdScore threshold applied before non-maximum suppression.anchors2Dnumpy.ndarrayof shape(N, 2)holding(w, h)anchor box dimensions the model was trained on. IfNone, a built-in default set of 5 anchors is used.nms_thresholdThreshold passed to non-maximum suppression.nms_sigmaSigma value passed to non-maximum suppression.- __call__(model: ml.Model, inputs: list, outputs: list) list
Invoked by
ml.Model.predict()to post-process model outputs.modelTheml.Modelinstance the post-processor is attached to.inputsList of model input objects (used to obtain the input ROI).outputsList of raw model output tensors.Returns a list of per-class lists of
((x, y, w, h), score)tuples. E.g.[[((x, y, w, h), score), ...], ...]. Empty class lists are kept so each list index matches the model’s class index.
class YoloLC – YOLO LC
Post-processor for YOLO LC model outputs. Subclass of YoloV2 that
provides a different default anchor set tuned for the YOLO LC model.
- class ml.postprocessing.darknet.YoloLC(threshold: float = 0.6, anchors: numpy.ndarray = None, nms_threshold: float = 0.1, nms_sigma: float = 0.1)
Create a YOLO LC postprocessor.
thresholdScore threshold applied before non-maximum suppression.anchors2Dnumpy.ndarrayof shape(N, 2)holding(w, h)anchor box dimensions the model was trained on. IfNone, a built-in default set of 5 YOLO LC anchors is used.nms_thresholdThreshold passed to non-maximum suppression.nms_sigmaSigma value passed to non-maximum suppression.