Skip to content
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

Task [pose estimation]: implement the general pose estimation API and utilities, plus integrate some initial models (e.g., mediapipe, DeepLabCut) #173

Open
brukew opened this issue Oct 10, 2024 · 12 comments · May be fixed by #203
Assignees
Labels
enhancement New feature or request

Comments

@brukew
Copy link

brukew commented Oct 10, 2024

Senselab Pose Estimation

Goal:
Integrate robust pose estimation workflows within Senselab

ViTPose performs best on infants - mediapipe and deeplabcut are low on accuracy


Support Plan

  • Start with MediaPipe

    • Easy to implement, lightweight (in terms of computation and speed)
  • Follow up with:

    • OpenPose: Best performance across humans and animals (depending on the specific model): Better performance than MediaPipe, but more computationally intensive
    • ViTPose: Best performance across humans and animals (depending on the specific model)
    • DeepLabCut: High performance on animal pose tracking

Workflow

  1. Upload media
  2. Receive custom output
  3. Perform further analysis using the output

Version Planning

  • V1:

    • Create pose estimations for images and videos
      • Custom datatypes for output
    • Support for MediaPipe
    • Visualization support
  • V2:

    • Expand support to OpenPose
  • V3:

    • Real-time pose detection across supported models (?)

Inputs/Outputs

  • Inputs:

  • Outputs:

    • PoseImage

      • Keypoints representing the pose skeleton
      • Visualization methods
    • PoseVideo

      • Keypoints representing the pose skeleton per video frame
      • Visualization methods

At each step, proper documentation and tests are expected. Tutorials will also be implemented for each workflow (across models and modalities).

@brukew brukew added this to senselab Oct 10, 2024
@brukew brukew self-assigned this Oct 10, 2024
@brukew brukew converted this from a draft issue Oct 10, 2024
Copy link

github-actions bot commented Oct 10, 2024

👋 Welcome to Senselab!

Thank you for your interest and contribution. Senselab is a comprehensive Python package designed to process behavioral data, including voice and speech patterns, with a focus on reproducibility and robust methodologies. Your issue will be reviewed soon. Stay tuned!

@fabiocat93 fabiocat93 added the enhancement New feature or request label Oct 10, 2024
@fabiocat93
Copy link
Collaborator

hi @brukew , sounds nice. Do you mind sharing some more detailed insights on your plan?

For example,

  • what is the interface that you plan to build? What is the input? what is the output?
  • what are the required quality checks that will determine the acceptability of your PRs? Can be unit tests, docstrings, tutorials, ...
  • what more tools to you plan to integrate? how did you end up starting with DeepLabCut?

I would recommend clarifying all these aspects before starting coding.
Also, I do recommend thinking about some utility functions for plotting human pose (alone and overlapped to the original picture) and some utility data structure for the human pose so that you can save and process the results of the different models in the same way

@brukew
Copy link
Author

brukew commented Oct 11, 2024

thanks @fabiocat93, sounds good! Will update the issue as I make the plan.

@fabiocat93 fabiocat93 changed the title Task [pose estimation]: integrate DeepLabCut Task [pose estimation]: implement the general pose estimation API and utilities, plus integrate some initial models (e.g., mediapipe, DeepLabCut) Oct 16, 2024
@fabiocat93
Copy link
Collaborator

Senselab Pose Estimation

Goal: Integrate robust pose estimation workflows within Senselab

ViTPose performs best on infants - mediapipe and deeplabcut are low on accuracy

Support Plan

  • Start with MediaPipe

    • Easy to implement, lightweight (in terms of computation and speed)
  • Follow up with:

    • OpenPose: Best performance across humans and animals (depending on the specific model): Better performance than MediaPipe, but more computationally intensive
    • ViTPose: Best performance across humans and animals (depending on the specific model)
    • DeepLabCut: High performance on animal pose tracking

Workflow

  1. Upload media
  2. Receive custom output
  3. Perform further analysis using the output

Version Planning

  • V1:

    • Create pose estimations for images and videos

      • Custom datatypes for output
    • Support for MediaPipe

    • Visualization support

  • V2:

    • Expand support to OpenPose
  • V3:

    • Real-time pose detection across supported models (?)

Inputs/Outputs

  • Inputs:

  • Outputs:

    • PoseImage

      • Keypoints representing the pose skeleton
      • Visualization methods
    • PoseVideo

      • Keypoints representing the pose skeleton per video frame
      • Visualization methods

At each step, proper documentation and tests are expected. Tutorials will also be implemented for each workflow (across models and modalities).

Thank you @brukew . This is good. Here are a couple of comments:

  • My understanding is that different models capture different joints during their pose estimation. How do you feel about implementing a senselab data structure for the human skeleton so that (i) all models with end up producing such data structure as a response and (ii) comparisons between models is going to be facilitated?
  • As a follow-up, how about implementing some utilities for visualizing the senselab skelethon? Can be on the original or on a black/white backgrounds. This is surely gonna help testing, demos, models comparison, ...

As a minor note, feel free to reply in a thread instead of simply editing the original text of the issue. this way, we can keep track of all the reasoning process (this is mostly helpful to me, since my memory is not that great! thanks!)

@fabiocat93
Copy link
Collaborator

Also, here is a good document overviewing pose estimation as a task: https://medium.com/augmented-startups/top-9-pose-estimation-models-of-2022-70d00b11db43

Consider that you are not necessarily required to implement everything yourself. People have been working in the domain for a while and you can use their models and their utility functions. For instance, here is a related project you should look at:

Here are some more models I have tried recently and could be good to add at some point in the future:

@satra
Copy link
Collaborator

satra commented Oct 16, 2024

there is also SLEAP and DANNCE and TULIP from here https://www.tdunnlab.org/

@brukew
Copy link
Author

brukew commented Oct 16, 2024

@fabiocat93 Yes, both of your points make sense. The number of joints differs greatly between each model - I assume we want all information retained though so the pose skeleton object will just vary in size/content per model. I will look into how to ensure this is done best - maybe just hardcoding matches between the key points of each model and labeling it the same.

How should I approach using existing toolkits? If I just want a minor visualization utility function for example, would I need to add the whole toolkit as a requirement and import it? or would it be fine to just take the code from their github?

@fabiocat93
Copy link
Collaborator

How should I approach using existing toolkits? If I just want a minor visualization utility function for example, would I need to add the whole toolkit as a requirement and import it? or would it be fine to just take the code from their github?

Good question. If you can isolate a specific function that you need, you can simply copy-paste that and report the source+mentioning their LICENSE. Obv, this assumes that their license allows doing that

@brukew
Copy link
Author

brukew commented Oct 17, 2024

Also, I have been thinking about this in the evaluation sense—not necessarily training or fine-tuning a model. This could definitely be added in the future, but am I right in prioritizing evaluation?

@fabiocat93
Copy link
Collaborator

Hey @brukew, do you mind giving me a quick update? I know you keep Satra in the loop with your weekly reports, but I'd love to stay up to speed, too! Thanks!

@brukew
Copy link
Author

brukew commented Nov 15, 2024

Hey, yeah. Finished up with an implementation for mediapipe - will push a pr for it soon. Having issues with dependencies when running poetry install - if you are available sometime today, would be nice to clear that up.

@brukew brukew linked a pull request Nov 19, 2024 that will close this issue
3 tasks
@brukew brukew linked a pull request Nov 19, 2024 that will close this issue
3 tasks
@fabiocat93
Copy link
Collaborator

hi guys @brukew, how is it going with this? I will extend your deadline (from Dec 13 to Jan 14). Please, let me know if you face any blockers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants