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>

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
common
abstract class ImageRecognitionModelBase<I>(internalModel: <ERROR CLASS>, modelKindDescription: String?)

Base class for image classification models.

InputType
Link copied to clipboard
common
enum InputType : Enum<InputType>

Different Neural Networks were trained on ImageNet dataset with different image preprocessing. The main types of preprocessing widely used in keras.applications are presented in this enumeration.

Functions

predictTop5Labels
Link copied to clipboard
common
fun <ERROR CLASS>.predictTop5Labels(data: FloatArray, classLabels: Map<Int, String>): List<<ERROR CLASS><String, Float>>

Returns top-5 labels for the given data encoded with mapping classLabels.

predictTopNLabels
Link copied to clipboard
common
fun <ERROR CLASS>.predictTopNLabels(floatArray: FloatArray, labels: Map<Int, String>, n: Int = 5): List<<ERROR CLASS><String, Float>>

Returns top-N labels for the given floatArray encoded with mapping labels.