Closed Matokosp closed 3 years ago
Pose should be returning estimated (x,y,z) locations for every canonical landmark in the person's body. It looks like you're using left-shoulder, right-shoulder, and left-hip keypoints if I'm reading the code correctly. I think there are quite a few directions you could go with this in terms of heuristics for "facing left", "facing right" or "facing straight ahead". Here's the first one I thought of, using those keypoints:
This seems basically like what you're attempting to do above via the angle calculation-- but that might be making things a bit more complicated than necessary. For example, I'm not sure why you stop using the angle calculation and switch to using visibility. Also, one thing to note is that Math.atan limits resulting angles to [-pi/2, pi/2], so I think you probably want Math.atan2 instead, so you can map onto the entire circle.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.
Please make sure that this is a solution issue.
System information (Please provide as much relevant information as possible)
Describe the expected behavior: I'm trying to recognize which side of the person is facing the camera. Im using the z axis and each time I put a profile facing the camera it reaches 0 degrees, but I can't seem to work around a solution to distinguish which side it is (right or left profile)
Standalone code you may have used to try to get what you need :
let radians = Math.atan(results[23].x - results[11].x, results[23].z - results[11].z) - Math.atan(results[12].x - results[11].x, results[12].z - results[11].z) let angle = Math.abs(radians*180.0/Math.PI) if (angle > 180.0) { angle = 360-angle } let right_interest = [11,23] if (angle <= 1) { if (right_interest.forEach((e) => results[e].visibility < 0.7)) { console.log('right side') } }
If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/repo link /any notebook:
Other info / Complete Logs : Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached: