public class YoloUtils extends Object
Constructor and Description |
---|
YoloUtils() |
Modifier and Type | Method and Description |
---|---|
static INDArray |
activate(INDArray boundingBoxPriors,
INDArray input)
Essentially: just apply activation functions...
|
static INDArray |
activate(INDArray boundingBoxPriors,
INDArray input,
LayerWorkspaceMgr layerWorkspaceMgr) |
static List<DetectedObject> |
getPredictedObjects(INDArray boundingBoxPriors,
INDArray networkOutput,
double confThreshold,
double nmsThreshold)
Given the network output and a detection threshold (in range 0 to 1) determine the objects detected by
the network.
Supports minibatches - the returned DetectedObject instances have an example number index.Note that the dimensions are grid cell units - for example, with 416x416 input, 32x downsampling by the network (before getting to the Yolo2OutputLayer) we have 13x13 grid cells (each corresponding to 32 pixels in the input image). |
static double |
iou(DetectedObject o1,
DetectedObject o2)
Returns intersection over union (IOU) between o1 and o2.
|
static void |
nms(List<DetectedObject> objects,
double iouThreshold)
Performs non-maximum suppression (NMS) on objects, using their IOU with threshold to match pairs.
|
static double |
overlap(double x1,
double x2,
double x3,
double x4)
Returns overlap between lines [x1, x2] and [x3.
|
public static INDArray activate(INDArray boundingBoxPriors, INDArray input)
public static INDArray activate(INDArray boundingBoxPriors, INDArray input, LayerWorkspaceMgr layerWorkspaceMgr)
public static double overlap(double x1, double x2, double x3, double x4)
public static double iou(DetectedObject o1, DetectedObject o2)
public static void nms(List<DetectedObject> objects, double iouThreshold)
public static List<DetectedObject> getPredictedObjects(INDArray boundingBoxPriors, INDArray networkOutput, double confThreshold, double nmsThreshold)
DetectedObject
instances have an example number index.boundingBoxPriors
- as given to Yolo2OutputLayernetworkOutput
- 4d activations out of the networkconfThreshold
- Detection threshold, in range 0.0 (least strict) to 1.0 (most strict). Objects are returned
where predicted confidence is >= confThresholdnmsThreshold
- passed to nms(List, double)
(0 == disabled) as the threshold for intersection over union (IOU)Copyright © 2018. All rights reserved.