-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Media Pipe Pose Estimation + Visualization #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 First Pull Request 🎉
Welcome to Senselab, and thank you for submitting your first pull request! We’re thrilled to have your contribution. Our team will review it as soon as possible. Stay engaged, and let’s make behavioral data analysis even more powerful together!
Thank you, @brukew, for the updates. I have a few suggestions and points to address based on our previous discussions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brukew, I have commented some required changes.
Nice, thank you for the feedback @fabiocat93. I will address your comments and ask questions as I go. |
e1a7696
to
269f0a6
Compare
hi @brukew , did you have any time to work further on this? |
hey @fabiocat93, slowed down on development towards the end of the semester. I will continue this month. |
@fabiocat93 lmk what you think about having separate estimator classes for different models. also, I kept the landmark names as they are originally listed but wondering if I should homogenize them at all. |
Good question. You can have multiple estimators, each being a child of the same abstract class and producing a skeleton following the same universal structure |
addressed model download by downloading models to video/tasks/pose_estimation/models upon use. Let me know if there is a better alternative to this that is more in line with senselab use. |
also wondering how I can ensure tutorial works (and cells are run in tutorial) if changes haven't been pushed to main branch @fabiocat93. should I wait until after? |
Good for now. But you raised a good point. We will need to implement a customizable cache folder for the package (of course with a default value) |
When testing the tutorial locally, you can install the package directly from a specific branch instead of relying on |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #203 +/- ##
==========================================
+ Coverage 60.24% 65.46% +5.21%
==========================================
Files 113 128 +15
Lines 4017 4572 +555
==========================================
+ Hits 2420 2993 +573
+ Misses 1597 1579 -18 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brukew : great work on this! I have a few suggestions and questions for consideration:
- I noticed the visualization method in the tutorial doesn't actually visualize the image but returns the array representation. Don’t you think it would make more sense for a visualization method (with the word visualize in the name) to display the image directly? Returning the array (and optionally saving it) could still be included as additional functionality.
- Is there a specific reason for having both IndividualPose and ImagePose? Would it make sense to simplify by treating IndividualPose as a special case of ImagePose where there’s only one subject? It might reduce redundancy and improve maintainability.
- I noticed there’s no mapping of the skeletons into a more general senseLab skeleton yet, and the visualization method is method-specific rather than generic for senselab. Was there a challenge in unifying this? Having two different skeletons and implementations feels less maintainable. Is there a particular reason for this approach?
Let me know if you’d like to discuss any of these points. I’m happy to help! Also, let me know if you prefer to fix the minor questions and merge and keep the rest of the changes for a future PR or if you want to keep it more ordered and work on this until everything is ready.
A quick note for the entire group about installation: the number of dependencies, especially for video, makes installation quite heavy. Moving forward, we might want to split the package into modules like senselab[audio], senselab[video], and senselab[text]. This would simplify installation based on the user’s needs |
Hey @fabiocat93, thanks for the comments - I will make all changes before merging. Here are my thoughts:
|
You convinced me with this. but how about always returning back an ImagePose object (which may include as many IndividualPose objects as the number of people detected?)
Sounds great! And please let me know if you need or want to brainstorm it further before implementing it. |
@fabiocat93 Addressed the visualization and keypoint mapping comments. The unit tests kept failing on Git Hub when a plot was created - my workaround was adding a bool parameter for plotting but let me know if there is another way that you want me to handle that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Nice job @brukew ! Looking forward to seeing more models integrated and some cools analyses based on this!!
Description
Implemented Media Pipe pose estimation. Given an image path, will return a PoseSkeleton object with landmarks of each individual in the image.
Related Issue(s)
https://github.com/orgs/sensein/projects/45/views/3?pane=issue&itemId=82951656&issue=sensein%7Csenselab%7C173
Motivation and Context
This is the initial structure for pose estimation which is a valuable signal for behavior analysis. I will expand to more models and functionality, and with that, this will be more generalized.
How Has This Been Tested?
I tested with different kinds of images and attempts to access invalid properties of the PoseSkeleton object. Unit tests for the new functions + also manually tested for proper visualization.
Screenshots (if appropriate):
Types of changes
Created PoseSkeleton object that contains pose information for individuals in an image. Currently supports MediaPipe pose estimation + visualization functionality.
Checklist: