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

Generalize mediapipe code to other trackers #536

Draft
wants to merge 88 commits into
base: main
Choose a base branch
from

Conversation

philipqueen
Copy link
Collaborator

@philipqueen philipqueen commented Jan 23, 2024

Currently, we define a lot mediapipe specific variables that are passed around Freemocap. This is things like the number of points tracked, joint connections and names, and center of mass related numbers. The goal is to have all of these model specific variables be housed in Skellytracker, and imported into the ProcessingParameterModel in Freemocap. Then all references to mediapipe specific code can instead pull generalized variables from the parameter model.

There are a few places that are still mediapipe dependent, including:

  • DataLoader class, which is only used in the DataSaver right now
  • Blender Megascript Take 2 (which we may or may not find worth updating)

We also need to update the various subrepos, which are using their own copies of the mediapipe variables. The goal is to have these passed into the subrepos, which will also prevent a lot of existing duplication:

  • Skellyviewer
  • Skellyforge
  • BlenderAddOn (we'll do this last, as there may be a lot of mediapipe dependency here)

This PR depends on a PR in skellytracker which has not yet been merged:
freemocap/skellytracker#15
To get the latest skellytracker version, run pip install skellytracker@git+https://github.com/freemocap/skellytracker@philip/flesh_out_mediapipe_model_info

MocapMike and others added 26 commits November 12, 2023 08:23
* Update and rename publish_to_pypi_when_new_tag_is_pushed_to_main.yml to publish_to_pypi.yml

update pypi publish methods

* Update publish_to_pypi.yml

* updating GH Action

* set python version to 3.11

* bump version to 1.0.26

* trying revert to `flit` build method

* Bump version v1.0.25 -> v1.0.26

* Bump version v1.0.26 -> v1.0.27

* add ajc27-freemocap-blender-addon as pip dependency

* Bump version v1.0.27 -> v1.0.28

* update version and add <3.12 to python spec

* Revert "update version and add <3.12 to python spec"

This reverts commit e77d1e9.

* specify python <3.12 and update version in pyprojs

* pass linting checks

* update tests and linting to check on prs into dev

* pin addon version beyond bone constraint patch

---------

Co-authored-by: jonmatthis <jonmatthis@gmail.com>
* add status check to see if recording is single vid

* only futz with calib toml if multi video

* lint
* Merge main history changes into development (#503)

* clean big files (.mp4, dlc models, etc) from deep git history 😬😅

* dummy commit

---------

Co-authored-by: jonmatthis <jonmatthis@gmail.com>

* try install pytest with others deps

* see if libegl-mesa-dev helps

* try removing pip cache

* set qt to debug plugins

* try pinning pyqt6

* try on python 3.10

* try 3.9

* figure out qmake version

* looking for pyqt info

* more qt futzing

* get linux system info

* try installing libxcb

* try installing qt6

* fix qt version

* force reinstall pyqt6

* make parameter model name less confusing

* scrap outdated mediapipe threshold parameter

* shiny new process recording folder function

* add COM todo

* queue todo

* replacing the processing recording folder with new one

* bug fix

* separate out anatomical data calculations

* pass queue down to subfunction

* remove queue todo

* integrating skellytracker

* getting the pipeline running

* add .pt files to gitignore (yolo models)

* rework pipeline with error handling

* add kill event exception class

* remove split and export data function

* add pipeline check before beginning processing

* fix pipeline check logic and key

* replace mediapipe parameters with skellytracker
replace skip steps with run steps

* remove old_process_recording_folder

* delete process folder of videos function
moved to skelly_tracker

* change multiprocessing bool to num_processes

---------

Co-authored-by: jonmatthis <jonmatthis@gmail.com>
Co-authored-by: aaroncherian <aaron.cherian2@gmail.com>
* add space saving action to version testing

* run on PR to development

* remove 3.8 testing
* remove disk space cleanup

* turn free disc space back on
only touch .net, android, haskell
* add annotate charuco checkbox

* add annotate images to the gui state

* change checkbox text

* make checkbox track to statde on opening
* set parameter limits

* change "num processes" to "max num processes"
* remove previous thresholding

* reprojection error thresholding

* unit tests

* Add more unit testing

* remove mediapipe threshold from triangulate func

* add reprojection filtering to recording processing

* refactoring

* Put reproj filtering in parameter tree

* linting

* add labels to debug plot

* moving `save_npy` stuff out of `triangulate_3d`

* jon and philip refactor reproj filter code

* Get it working again

* Turn off filtering by default

* linting

* filter by confidence percentile

* ensure confidence values are between 0 and 100

* linting

* fix variable name

* parameterize minimum cameras to reproject

* fix the camera combination logic

* save reprojection error by camera

* By camera reprojection filtering (#469)

* Add by camera reprojection filtering

* functionalize unique frame marker list

* fix list indexing

* set up for iterating through cameras

* loop iteratively, exit gracefully

* fix looping error, remove debug plotting

* set leftover data above threshold to NaNs

* add minimum cameras to reproject to param model

* fix parameter gorup setting

* add unit testing

* redo debug plots

* change min cameras to reproject default to 3

* private functions and percentage reporting

* encapsulate functions

* remove outdated reprojection filtering code

* lint

* spelling fix

* adapt to new process recording folder

* fix misspelled import

* log directory if get_file function fails

* fix path mistake

* fix glob call

* log list instead of generator

* log raw data folder contents

* remove unused reprojection filtering

* separate out reprojection filtering run function
change skip step to run step

* update output data folder path

---------

Co-authored-by: jonmatthis <jonmatthis@gmail.com>
run triangulate_3d_data without saving
* set base logging display level to info

* remove stale code, fix widget ordering errors

* connect active recording info after widget created

* change logging levels

* add some typing

* change logging levels and add todos

* change processing finished logger location

* log to freemocap folder instead of skellycam

* nix remaining skellycam references

* set log view widget to info, rest to debug

* fix random missing import bug

* log blender messages (need to clean up on add on side)

* reduce logging around sample data download

* log during anipose camera calibration

* set global logging back to trace

* proper display of calibration path for single videos

* Log progress indicator (#525)

* logging progress, but at what cost?
(the cost of too many lines printed)

* animate active progress

* Parameterize progress bar creation

* Initiate bar with special name

* get rid of unused import

* swap print statement for logging

* fix active recording widget on startup

* handle attribute error exception in active recording handling

* lint and PR suggestion changes

---------

Co-authored-by: jonmatthis <jonmatthis@gmail.com>
* Run blender from threadworker

* don't try to copy nonexistent calibrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants