public class DetectionModel extends Model
Constructor and Description |
---|
DetectionModel(Net network)
Create model from deep learning network.
|
DetectionModel(java.lang.String model)
Create detection model from network represented in one of the supported formats.
|
DetectionModel(java.lang.String model,
java.lang.String config)
Create detection model from network represented in one of the supported formats.
|
Modifier and Type | Method and Description |
---|---|
static DetectionModel |
__fromPtr__(long addr) |
void |
detect(Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes)
Given the
input frame, create input blob, run net and return result detections. |
void |
detect(Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes,
float confThreshold)
Given the
input frame, create input blob, run net and return result detections. |
void |
detect(Mat frame,
MatOfInt classIds,
MatOfFloat confidences,
MatOfRect boxes,
float confThreshold,
float nmsThreshold)
Given the
input frame, create input blob, run net and return result detections. |
boolean |
getNmsAcrossClasses()
Getter for nmsAcrossClasses.
|
DetectionModel |
setNmsAcrossClasses(boolean value)
nmsAcrossClasses defaults to false,
such that when non max suppression is used during the detect() function, it will do so per-class.
|
getNativeObjAddr, predict, setInputCrop, setInputMean, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputScale, setInputSize, setInputSize, setInputSwapRB, setPreferableBackend, setPreferableTarget
public DetectionModel(Net network)
network
- Net object.public DetectionModel(java.lang.String model)
model
and config
arguments does not matter.model
- Binary file contains trained weights.public DetectionModel(java.lang.String model, java.lang.String config)
model
and config
arguments does not matter.model
- Binary file contains trained weights.config
- Text file contains network configuration.public static DetectionModel __fromPtr__(long addr)
public void detect(Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes)
input
frame, create input blob, run net and return result detections.classIds
- Class indexes in result detection.confidences
- A set of corresponding confidences.boxes
- A set of bounding boxes.frame
- automatically generatedpublic void detect(Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes, float confThreshold)
input
frame, create input blob, run net and return result detections.classIds
- Class indexes in result detection.confidences
- A set of corresponding confidences.boxes
- A set of bounding boxes.confThreshold
- A threshold used to filter boxes by confidences.frame
- automatically generatedpublic void detect(Mat frame, MatOfInt classIds, MatOfFloat confidences, MatOfRect boxes, float confThreshold, float nmsThreshold)
input
frame, create input blob, run net and return result detections.classIds
- Class indexes in result detection.confidences
- A set of corresponding confidences.boxes
- A set of bounding boxes.confThreshold
- A threshold used to filter boxes by confidences.nmsThreshold
- A threshold used in non maximum suppression.frame
- automatically generatedpublic boolean getNmsAcrossClasses()
public DetectionModel setNmsAcrossClasses(boolean value)
value
- The new value for nmsAcrossClassesGenerated on 2021-12-25 08:13:27 / OpenCV 4.5.5