OnnxInferenceModel

open class OnnxInferenceModel : InferenceModel

Inference model built on ONNX format.

Since

0.3

Constructors

OnnxInferenceModel
Link copied to clipboard
fun OnnxInferenceModel()

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
open override fun close()

Releases the ONNXRuntime - related resources.

copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): TensorFlowInferenceModel
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): Map<String, Any>

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

inputDataType
Link copied to clipboard
lateinit var inputDataType: OnnxJavaType

Data type for input tensor.

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?
outputDataType
Link copied to clipboard
lateinit var outputDataType: OnnxJavaType

Data type for output tensor.

outputShape
Link copied to clipboard
lateinit var outputShape: LongArray

Data shape for prediction.

Inheritors

EfficientDetObjectDetectionModel
Link copied to clipboard
SSDMobileNetV1ObjectDetectionModel
Link copied to clipboard
SSDObjectDetectionModel
Link copied to clipboard
MultiPoseDetectionModel
Link copied to clipboard
SinglePoseDetectionModel
Link copied to clipboard