Class DetectionModel
This class represents high-level API for object detection networks.
public class DetectionModel : Model, IDisposable
- Inheritance
-
DetectionModel
- Implements
- Inherited Members
Constructors
DetectionModel(Net)
Create model from deep learning network.
public DetectionModel(Net net)
Parameters
net
NetDNN Network
DetectionModel(string, string)
Create detection model from network represented in one of the supported formats.
public DetectionModel(string model, string config = null)
Parameters
model
stringBinary file contains trained weights.
config
stringText file contains network configuration.
Properties
NmsAcrossClasses
It true, will perform non-maximum suppression across classes
public bool NmsAcrossClasses { get; set; }
Property Value
Methods
Detect(IInputArray, VectorOfInt, VectorOfFloat, VectorOfRect, float, float)
Given the input frame, create input blob, run net and return result detections.
public void Detect(IInputArray frame, VectorOfInt classIds, VectorOfFloat confidences, VectorOfRect boxes, float confThreshold = 0.5, float nmsThreshold = 0)
Parameters
frame
IInputArrayThe input image.
classIds
VectorOfIntClass indexes in result detection.
confidences
VectorOfFloatA set of corresponding confidences.
boxes
VectorOfRectA set of bounding boxes.
confThreshold
floatA threshold used to filter boxes by confidences.
nmsThreshold
floatA threshold used in non-maximum suppression. The default value 0 means we will not perform non-maximum suppression.
DisposeObject()
Release the memory associated with this detection model.
protected override void DisposeObject()