googlesamples / googlesamples/mlkit

Pose detection keypoints are little dislocated in iOS

Open
#417 0 comments 0 reactions 1 assignee Claimed by @bcdj View on GitHub
Dominant language
Kotlin
Stars
4.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

I've tried MLKit sample app (ios-> quickstarts ->vision). It seems pose keypoints are dislocated on iOS.
Please look into [sample](https://drive.google.com/file/d/186czWlzrypaUWGVRKCFQwzY_bfLVi33q/view?usp=sharing).
if we look into this sample, face key points (eyes, nose, ears, etc.. ) are totally dislocated.
I guess but not exactly, points are not properly converted with the following function:

> private func convertedPoints(
> from points: [NSValue]?,
> width: CGFloat,
> height: CGFloat
> ) -> [NSValue]? {
> return points?.map {
> let cgPointValue = $0.cgPointValue
> let normalizedPoint = CGPoint(x: cgPointValue.x / width, y: cgPointValue.y / height)
> let cgPoint = previewLayer.layerPointConverted(fromCaptureDevicePoint: normalizedPoint)
> let value = NSValue(cgPoint: cgPoint)
> return value
> }
> }

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.