SSDObjectDetectionModel

class SSDObjectDetectionModel : OnnxInferenceModel

Special model class for detection objects on images with built-in preprocessing and post-processing.

It internally uses SSD model trained on the COCO dataset.

Since

0.3

See also

Constructors

SSDObjectDetectionModel
Link copied to clipboard
fun SSDObjectDetectionModel()

Functions

close
Link copied to clipboard
open override fun close()
copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): TensorFlowInferenceModel
detectObjects
Link copied to clipboard
fun detectObjects(imageFile: File, topK: Int = 5): List<DetectedObject>
fun detectObjects(inputData: FloatArray, topK: Int = 5): List<DetectedObject>

Returns the top N detected object for the given image file.

evaluate
Link copied to clipboard
fun evaluate(dataset: Dataset, metric: Metrics): Double
predict
Link copied to clipboard
open override fun predict(inputData: FloatArray): Int
fun predict(dataset: Dataset): List<Int>
fun predict(inputData: FloatArray, inputTensorName: String, outputTensorName: String): Int

Predicts the class of inputData.

predictRaw
Link copied to clipboard
fun predictRaw(inputData: FloatArray): List<Array<*>>

Returns list of multidimensional arrays with data from model outputs.

predictRawWithShapes
Link copied to clipboard
fun predictRawWithShapes(inputData: FloatArray): List<Pair<FloatBuffer, LongArray>>

Returns list of pairs from model outputs.

predictSoftly
Link copied to clipboard
fun predictSoftly(inputData: FloatArray): FloatArray

Predicts vector of probabilities instead of specific class in predict method.

open override fun predictSoftly(inputData: FloatArray, predictionTensorName: String): FloatArray
reshape
Link copied to clipboard
open override fun reshape(vararg dims: Long)

Chain-like setter to set up input shape.

toString
Link copied to clipboard
open override fun toString(): String

Properties

inputDimensions
Link copied to clipboard
open override val inputDimensions: LongArray
inputShape
Link copied to clipboard
lateinit var inputShape: LongArray

Data shape for prediction.

name
Link copied to clipboard
var name: String?
outputShape
Link copied to clipboard
lateinit var outputShape: LongArray

Data shape for prediction.