Skip to content

Add dlclibrary for model download from zoo#2088

Merged
MMathisLab merged 11 commits into
mainfrom
add_dlclib_in
Dec 22, 2022
Merged

Add dlclibrary for model download from zoo#2088
MMathisLab merged 11 commits into
mainfrom
add_dlclib_in

Conversation

@jeylau
Copy link
Copy Markdown
Contributor

@jeylau jeylau commented Dec 14, 2022

Fixes #2086

@jeylau jeylau added the enhancement New feature or request label Dec 14, 2022
@jeylau jeylau requested review from AlexEMG and MMathisLab December 14, 2022 09:49
@jeylau jeylau self-assigned this Dec 14, 2022
Copy link
Copy Markdown
Member

@AlexEMG AlexEMG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the /tools files should stay. Let's also add a unit-test for downloading model zoo weights to DLC (so we catch problems with DLClib here)?

@AlexEMG
Copy link
Copy Markdown
Member

AlexEMG commented Dec 14, 2022

also let's add dlclib to setup.py?

@jeylau
Copy link
Copy Markdown
Contributor Author

jeylau commented Dec 15, 2022

the /tools files should stay. Let's also add a unit-test for downloading model zoo weights to DLC (so we catch problems with DLClib here)?

why? it's part of dlclib too

@AlexEMG
Copy link
Copy Markdown
Member

AlexEMG commented Dec 15, 2022

Right, good to use CLI at DLClib, but I think testing it here too, will make sure that we catch it (as I assume we and others look more on DLC's CLI).

@MMathisLab MMathisLab marked this pull request as ready for review December 20, 2022 19:22
* Update branch name
* Remove GUI-related deps from requirements.txt
* Update actions' versions

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>
@MMathisLab MMathisLab added the ModelZoo related to models/code for modezoo.deeplabcut.org label Dec 20, 2022
@AlexEMG AlexEMG self-requested a review December 20, 2022 19:54
@MMathisLab
Copy link
Copy Markdown
Member

ready to merge @jeylau ? @yeshaokai ?

@yeshaokai
Copy link
Copy Markdown
Collaborator

I haven't tested all cases. It works for my use cases.

@MMathisLab MMathisLab merged commit 072c040 into main Dec 22, 2022
@MMathisLab MMathisLab deleted the add_dlclib_in branch December 22, 2022 15:27
jeylau added a commit that referenced this pull request Dec 23, 2022
* Remove tools folder

* Add dlclibrary for model download from zoo

* also remove old weight download function

* Add dlclibrary to setup.py

* Update branch name to "main" in GitHub's CI workflow (#2089) (#2092)

* Update branch name
* Remove GUI-related deps from requirements.txt
* Update actions' versions

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* put tools back

* updated headers.

* update requirements for CLI

* fix trailing """

* model zoo unit-test

* DLC 2.3

Co-authored-by: Alexander Mathis <alexander@deeplabcut.org>
Co-authored-by: Mackenzie Mathis <mathis@rowland.harvard.edu>
AlexEMG added a commit that referenced this pull request Mar 7, 2023
* Added inference code for incoming super models

* handled empty prediction in multiple scale prediction. Formatting

* Update deeplabcut/pose_estimation_tensorflow/predict_supermodel.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/pose_estimation_tensorflow/predict_supermodel.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/pose_estimation_tensorflow/predict_supermodel.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/pose_estimation_tensorflow/predict_supermodel.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* fixed DLCscorer in make_label_video for suffix

* Added example document. Added top down inference

* Fixed previous commit

* Made the scorer convetion include DLC_

* handled the case where one of topdown prediction gives empty prediction

* first docs started

* Update _toc.yml

* change scale_list nonoptional

* Added functional test script and api docs

* Fixed a formatting

* safer way to parse num_kpts

* Made the superanimal inference simpler

* Simplify the API and added more docs

* changed the relative path in the rst file

* Fixed circular import

* Fixed known issue

* Further getting rid of the dependency on config for inference

* make_labeled_video takes superanimal_name now

* Update docs/ModelZoo.md

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Cleanup and removal of bbox file

* Minor fixes

* Run black and isort

* Remove unused variables

* Get rid of the additional VideoWriter

* Fix test

* Hide _video_inference from high-level API

* Add test_get_multi_scale_frames

* Clean configs

* Accelerate pandas's code

* Test projection back to original image size

* Faster DataFrame creation

* Remove tools folder

* Add dlclibrary for model download from zoo

* also remove old weight download function

* Add dlclibrary to setup.py

* Added modelzoo folder

* removed domain matcher for now

* fix last commit

* Users define threshold and pcutoff for adaptation api

* Added documentation. Only keep the without project way of using the api

* Now video adaptation code uses video reader for training

* reformatting

* Update deeplabcut/modelzoo/apis/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/modelzoo/apis/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/modelzoo/apis/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Remove unused imports

* Remove duplicate code

* Fixed unused threshold

* Avoid hardcoding supermodel names

* Add missing `vid` attribute

* Delay import

* Add missing attribute

* Add video adaptation to GUI

* Update branch name to "main" in GitHub's CI workflow (#2089)

* Update branch name
* Remove GUI-related deps from requirements.txt
* Update actions' versions

* inference api and adaptation api work with hugging face weights

* minor update

* trying to avoid circular import

* WIP fixing previous commit

* fixed logic for getting image shape for video adaptation

* smaller batch sizes in train configs

* fix the path after enforcing abs path

* Added colab example

* adaptation api takes kwargs

* updated docstring for inference code

* Update ModelZoo.md

* Add dlclibrary for model download from zoo (#2088)

* Remove tools folder

* Add dlclibrary for model download from zoo

* also remove old weight download function

* Add dlclibrary to setup.py

* Update branch name to "main" in GitHub's CI workflow (#2089) (#2092)

* Update branch name
* Remove GUI-related deps from requirements.txt
* Update actions' versions

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* put tools back

* updated headers.

* update requirements for CLI

* fix trailing """

* model zoo unit-test

* DLC 2.3

Co-authored-by: Alexander Mathis <alexander@deeplabcut.org>
Co-authored-by: Mackenzie Mathis <mathis@rowland.harvard.edu>

* Backwards comp

* Add some multi-animal defaults

* Add a missing parameter

* Add empty paf graph

* Change dataset_type to single-animal

* Update ModelZoo.md

* Minor fixes

* Video adaptation api (up to date) (#2116)

* Fixed previous commit

* first docs started

* Added functional test script and api docs

* Simplify the API and added more docs

* Add dlclibrary for model download from zoo

* Now video adaptation code uses video reader for training

* reformatting

* Update ModelZoo.md

* Add some multi-animal defaults

* allow more custom changes

* change model names in models.json to fit the official convention

* updated test scripts

* Added test script for adaptation api. Handled empty predictions

* Get rid of get_nuances function

* rename modelzoo/apis to modelzoo/api. Make it possible to choose video adaptation in the inference api

* updated the doc string

* addressed jessys comments

* ran black

* Update ModelZoo.md

* Add back cute emojis

* no .imports now

* added back imgaug line

* Update deeplabcut/modelzoo/api/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/modelzoo/api/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/modelzoo/api/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Update deeplabcut/modelzoo/api/spatiotemporal_adapt.py

Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* adddressed jessys comments

Co-authored-by: Mackenzie Mathis <mathis@rowland.harvard.edu>
Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>

* Fix imports

* Fix multiprocessing RuntimeError

* Fix model zoo GUI tab

* Fix typo

* Fix custom config path

* Test video adaptation on a shorter video

* Avoid empty folder creation if not adapting

* Remove unused apply_filter flag

* Avoid multiprocessing when started with spawn

* Fix hardcoded paths

* Option to pass in display and saveiters

* Append video analysis success

* Silence numpy RuntimeWarnings

* Add Colab example and form fields

* 30x speedup of averaging over multiple scales

* Add Open in Colab badge

* Minor change

* Use newer API in modelzoo's GUI tab

* Add trajectory plotting to superanimal inference

* Update spatiotemporal_adapt.py

* Rename variable

* Add tools directory back in

---------

Co-authored-by: shaokaiye <shaokaiyeah@gmail.com>
Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>
Co-authored-by: Alexander Mathis <alexander@deeplabcut.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ModelZoo related to models/code for modezoo.deeplabcut.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model zoo google colab: full_human package huggingface URL has been change

4 participants