Package org.jetbrains.kotlinx.dl.onnx.inference.classification
Types
ImageRecognitionModel
Link copied to clipboard
open class ImageRecognitionModel(internalModel: OnnxInferenceModel, channelsFirst: Boolean, preprocessor: Operation<Pair<FloatArray, TensorShape>, Pair<FloatArray, TensorShape>>, modelKindDescription: String?, classLabels: Map<Int, String>) : ImageRecognitionModelBase<Bitmap> , ExecutionProviderCompatible, CameraXCompatibleModel
Content copied to clipboard
The light-weight API for Classification task with one of the Model Hub models.
Functions
predictObject
Link copied to clipboard
fun ImageRecognitionModelBase<Bitmap>.predictObject(imageProxy: ImageProxy): String
Content copied to clipboard
Predicts object for the given imageProxy. Internal preprocessing is updated to rotate image to match target orientation. After prediction, internal preprocessing is restored to the original state.
predictTopKObjects
Link copied to clipboard
fun ImageRecognitionModelBase<Bitmap>.predictTopKObjects(imageProxy: ImageProxy, topK: Int = 5): List<Pair<String, Float>>
Content copied to clipboard
Predicts topK objects for the given imageProxy. Internal preprocessing is updated to rotate image to match target orientation. After prediction, internal preprocessing is restored to the original state.