Package org.jetbrains.kotlinx.dl.impl.inference.imagerecognition
Types
ImageRecognitionModel
Link copied to clipboard
class ImageRecognitionModel(internalModel: InferenceModel, inputColorMode: ColorMode, channelsFirst: Boolean, preprocessor: Operation<Pair<FloatArray, TensorShape>, Pair<FloatArray, TensorShape>>, modelKindDescription: String?) : ImageRecognitionModelBase<BufferedImage>
Content copied to clipboard
The light-weight API for solving Image Recognition task with one of the Model Hub models trained on ImageNet dataset.
ImageRecognitionModelBase
Link copied to clipboard
abstract class ImageRecognitionModelBase<I>(internalModel: <ERROR CLASS>, modelKindDescription: String?)
Content copied to clipboard
Base class for image classification models.
Functions
predictTop5Labels
Link copied to clipboard
fun <ERROR CLASS>.predictTop5Labels(data: FloatArray, classLabels: Map<Int, String>): List<<ERROR CLASS><String, Float>>
Content copied to clipboard
Returns top-5 labels for the given data encoded with mapping classLabels.
predictTopNLabels
Link copied to clipboard
fun <ERROR CLASS>.predictTopNLabels(floatArray: FloatArray, labels: Map<Int, String>, n: Int = 5): List<<ERROR CLASS><String, Float>>
Content copied to clipboard
Returns top-N labels for the given floatArray encoded with mapping labels.