MultiPoseDetectionModel

class MultiPoseDetectionModel : OnnxInferenceModel

MultiPoseDetectionModel is an ultra-fast and accurate model that detects 6 persons with 17 keypoints and 18 basic edges of a body for each of them.

It internally uses ONNXModels.PoseDetection.MoveNetMultiPoseLighting under the hood to make predictions.

Constructors

MultiPoseDetectionModel
Link copied to clipboard
fun MultiPoseDetectionModel()

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
detectPoses
Link copied to clipboard
fun detectPoses(imageFile: File, confidence: Float = 0.1f): MultiPoseDetectionResult
fun detectPoses(inputData: FloatArray, confidence: Float = 0.005f): MultiPoseDetectionResult
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.