Class NullModel

java.lang.Object
org.photonvision.vision.objects.NullModel
All Implemented Interfaces:
Model, ObjectDetector, Releasable

public class NullModel extends Object implements Model, ObjectDetector
A 'null' implementation of the Model and ObjectDetector interfaces. This is used when no model is available to load.
  • Field Details

    • INSTANCE

      public static final NullModel INSTANCE
  • Method Details

    • getInstance

      public static NullModel getInstance()
    • load

      public ObjectDetector load()
      Specified by:
      load in interface Model
    • getName

      public String getName()
      Specified by:
      getName in interface Model
    • release

      public void release()
      Specified by:
      release in interface Releasable
    • getModel

      public Model getModel()
      Description copied from interface: ObjectDetector
      Returns the model that created this ObjectDetector.
      Specified by:
      getModel in interface ObjectDetector
    • getClasses

      public List<String> getClasses()
      Description copied from interface: ObjectDetector
      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)
      Description copied from interface: ObjectDetector
      Detects objects in the given input image. Preprocessing and postprocessing steps should be embedded into this call.
      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.