SinglePoseDetectionModel

class SinglePoseDetectionModel : OnnxInferenceModel

SinglePoseDetectionModel is an ultra-fast and accurate model that detects 17 keypoints and 18 basic edges of a body.

It internally uses ONNXModels.PoseDetection.MoveNetSinglePoseLighting or ONNXModels.PoseDetection.MoveNetSinglePoseThunder under the hood to make predictions.

Constructors

SinglePoseDetectionModel
Link copied to clipboard
fun SinglePoseDetectionModel()

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
detectPose
Link copied to clipboard
fun detectPose(imageFile: File): DetectedPose
fun detectPose(inputData: FloatArray): DetectedPose
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.