Class RknnObjectDetector

java.lang.Object
org.photonvision.jni.RknnObjectDetector
All Implemented Interfaces:
ObjectDetector, Releasable

public class RknnObjectDetector extends Object implements ObjectDetector
Manages an object detector using the rknn backend.
  • Constructor Details

    • RknnObjectDetector

      public RknnObjectDetector(RknnModel model, org.opencv.core.Size inputSize)
      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 be Letterboxed to this shape.
  • Method Details

    • getModel

      public RknnModel getModel()
      Returns the model in use by this detector.
      Specified by:
      getModel in interface ObjectDetector
    • getClasses

      public List<String> getClasses()
      Returns the classes that the detector can detect
      Specified by:
      getClasses in interface ObjectDetector
      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 interface ObjectDetector
      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 interface Releasable