Class ObjectDetectionTranslator

java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator<DetectedObjects>
ai.djl.modality.cv.translator.ObjectDetectionTranslator
All Implemented Interfaces:
PostProcessor<DetectedObjects>, PreProcessor<Image>, Translator<Image,DetectedObjects>
Direct Known Subclasses:
SingleShotDetectionTranslator, YoloTranslator, YoloV5Translator

public abstract class ObjectDetectionTranslator extends BaseImageTranslator<DetectedObjects>
A BaseImageTranslator that post-process the NDArray into DetectedObjects with boundaries.
  • Field Details

    • threshold

      protected float threshold
    • classes

      protected List<String> classes
    • imageWidth

      protected double imageWidth
    • imageHeight

      protected double imageHeight
    • applyRatio

      protected boolean applyRatio
  • Constructor Details

  • Method Details

    • prepare

      public void prepare(TranslatorContext ctx) throws Exception
      Prepares the translator with the manager and model to use.
      Parameters:
      ctx - the context for the Predictor.
      Throws:
      Exception - if there is an error for preparing the translator