Class NativeClassifier

java.lang.Object
com.xpdustry.nohorny.natives.NativeClassifier
All Implemented Interfaces:
AutoCloseable

public final class NativeClassifier extends Object implements AutoCloseable
A ViT image classifier running an ONNX model with OpenCV. Not thread-safe.
  • Method Details

    • create

      public static NativeClassifier create(Path model)
    • classify

      public float[] classify(BufferedImage image)
      Returns the softmax probabilities of each label, in the order of the model outputs.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable