tensorflow / tensorflow

An Open Source Machine Learning Framework for Everyone
https://tensorflow.org
Apache License 2.0
186.68k stars 74.35k forks source link

How to display custom label with angles in iOS? #56304

Closed IBSApple closed 2 years ago

IBSApple commented 2 years ago
Click to expand! ### Issue Type Feature Request ### Source source ### Tensorflow Version pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML', 'Metal'] ### Custom Code Yes ### OS Platform and Distribution _No response_ ### Mobile device _No response_ ### Python version _No response_ ### Bazel version _No response_ ### GCC/Compiler version _No response_ ### CUDA/cuDNN version _No response_ ### GPU model and memory _No response_ ### Current Behaviour? ```shell How to display degree of angle on every keyPoint. ``` ### Standalone code to reproduce the issue ```shell Below code for to create degree of angle I used func angle( firstLandmark: CGPoint, midLandmark: CGPoint, lastLandmark: CGPoint ) -> CGFloat { let radians: CGFloat = atan2(lastLandmark.y - midLandmark.y, lastLandmark.x - midLandmark.x) - atan2(firstLandmark.y - midLandmark.y, firstLandmark.x - midLandmark.x) var degrees = radians * 180.0 / .pi //var degrees = radians * .pi / 180 /// .pi degrees = abs(degrees) // Angle should never be negative if degrees > 180.0 { degrees = 360.0 - degrees // Always get the acute representation of the angle } let roundedValue1 = round(degrees) return roundedValue1 } ``` ### Relevant log output _No response_
IBSApple commented 2 years ago

WhatsApp Image 2022-05-31 at 9 41 26 AM Required like this, is it possible?

mohantym commented 2 years ago

Hi @IBSApple! Currently we don't have these features in TF-lite itself. Feel free to visit these solutions from mediapipe.

Facemesh- for Face detection Pose detection - for detection of other body parts.

Won't be this issue again a duplicate of previous feature requests. #56265 , #56294.
Thank you!

IBSApple commented 2 years ago

Ok thanks

IBSApple commented 2 years ago

Is it possible to add custom keyPoints in TF pose estimation?

mohantym commented 2 years ago

@IBSApple ! You can upload your own dataset and train it to get custom keypoints. Also attached a link to use mediapipe's facemesh detection directly in Colab for reference. Thank you!

google-ml-butler[bot] commented 2 years ago

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 2 years ago

Closing as stale. Please reopen if you'd like to work on this further.