Package org.photonvision.jni
Class RknnObjectDetector
java.lang.Object
org.photonvision.jni.RknnObjectDetector
- All Implemented Interfaces:
ObjectDetector
,Releasable
Manages an object detector using the rknn backend.
-
Constructor Summary
ConstructorDescriptionRknnObjectDetector
(RknnModel model, org.opencv.core.Size inputSize) Creates a new RknnObjectDetector from the given model. -
Method Summary
Modifier and TypeMethodDescriptiondetect
(org.opencv.core.Mat in, double nmsThresh, double boxThresh) Detects objects in the given input image using the RknnDetector.Returns the classes that the detector can detectgetModel()
Returns the model in use by this detector.void
release()
Thread-safe method to release the detector.
-
Constructor Details
-
RknnObjectDetector
Creates a new RknnObjectDetector from the given model.- Parameters:
model
- The model to create the detector from.inputSize
- The required image dimensions for the model. Images will beLetterbox
ed to this shape.
-
-
Method Details
-
getModel
Returns the model in use by this detector.- Specified by:
getModel
in interfaceObjectDetector
-
getClasses
Returns the classes that the detector can detect- Specified by:
getClasses
in interfaceObjectDetector
- Returns:
- The classes
-
detect
public List<NeuralNetworkPipeResult> detect(org.opencv.core.Mat in, double nmsThresh, double boxThresh) Detects objects in the given input image using the RknnDetector.- Specified by:
detect
in interfaceObjectDetector
- Parameters:
in
- The input image to perform object detection on.nmsThresh
- The threshold value for non-maximum suppression.boxThresh
- The threshold value for bounding box detection.- Returns:
- A list of NeuralNetworkPipeResult objects representing the detected objects. Returns an empty list if the detector is not initialized or if no objects are detected.
-
release
public void release()Thread-safe method to release the detector.- Specified by:
release
in interfaceReleasable
-