Created
June 9, 2022 09:50
-
-
Save zaleslaw/ccff494a2b86d4db64fff529efb43d03 to your computer and use it in GitHub Desktop.
Detects multiple poses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.use { poseDetectionModel -> | |
val imageFile = … | |
val detectedPoses = poseDetectionModel.detectPoses(imageFile = imageFile, confidence = 0.0f) | |
detectedPoses.multiplePoses.forEach { detectedPose -> | |
println("Found ${detectedPose.first.classLabel} with probability ${detectedPose.first.probability}") | |
detectedPose.second.poseLandmarks.forEach { | |
println("Found ${it.poseLandmarkLabel} with probability ${it.probability}") | |
} | |
detectedPose.second.edges.forEach { | |
println("The ${it.poseEdgeLabel} starts at ${it.start.poseLandmarkLabel} and ends with ${it.end.poseLandmarkLabel}") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment