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

Return heatmaps and backbone features during inference #212

Merged
merged 24 commits into from
Oct 31, 2020

Conversation

vsatyakumar
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commented Oct 23, 2020

CLA assistant check
All committers have signed the CLA.

@innerlee innerlee requested a review from jin-s13 October 23, 2020 04:05
@innerlee
Copy link
Contributor

how does other repos return features? maybe use hooks? i'm not sure keep changing return signatures is a sustainable way

@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #212 into master will increase coverage by 0.31%.
The diff coverage is 41.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #212      +/-   ##
==========================================
+ Coverage   82.90%   83.21%   +0.31%     
==========================================
  Files         106      108       +2     
  Lines        6211     6400     +189     
  Branches     1001     1030      +29     
==========================================
+ Hits         5149     5326     +177     
+ Misses        874      871       -3     
- Partials      188      203      +15     
Flag Coverage Δ
unittests 83.21% <41.62%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/datasets/datasets/__init__.py 100.00% <ø> (ø)
...datasets/datasets/top_down/topdown_mpii_dataset.py 42.71% <ø> (ø)
...sets/datasets/top_down/topdown_mpii_trb_dataset.py 51.75% <ø> (ø)
...datasets/datasets/top_down/topdown_coco_dataset.py 88.44% <33.33%> (+24.71%) ⬆️
...s/datasets/top_down/topdown_posetrack18_dataset.py 34.07% <34.07%> (ø)
mmpose/utils/hooks.py 47.05% <47.05%> (ø)
mmpose/apis/inference.py 68.21% <52.94%> (-3.42%) ⬇️
mmpose/models/detectors/top_down.py 77.91% <92.30%> (-0.22%) ⬇️
mmpose/datasets/datasets/top_down/__init__.py 100.00% <100.00%> (ø)
mmpose/datasets/pipelines/top_down_transform.py 78.18% <0.00%> (-2.43%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3028b9f...2fffccb. Read the comment docs.

@innerlee
Copy link
Contributor

there are linting errors. you can try to run pre-commit install on the root folder of the repo.
if pre-commit is not available, try pip install pre-commit

demo/top_down_img_demo.py Outdated Show resolved Hide resolved
demo/top_down_img_demo.py Outdated Show resolved Hide resolved
@jin-s13
Copy link
Collaborator

jin-s13 commented Oct 25, 2020

Good!
One more thing. Since the return of forward_test is changed, the evaluate functions in the topdown datasets should also be modified accordingly, e.g.

for preds, boxes, image_path, _ in outputs:

to
for preds, boxes, image_path in outputs:

@jin-s13
Copy link
Collaborator

jin-s13 commented Oct 25, 2020

Thanks!

And same issues here.

for preds, boxes, image_path, _ in outputs:

for preds, boxes, image_path, _ in outputs:

for preds, boxes, image_path, _ in outputs:

for preds, boxes, image_path, _ in outputs:

============================================

preds = np.stack([kpts[0] for kpts, _, _, _ in outputs])

to

preds = np.stack([kpts[0] for kpts, _, _ in outputs])

@jin-s13 jin-s13 requested a review from innerlee October 25, 2020 14:54
@vsatyakumar

This comment has been minimized.

@innerlee
Copy link
Contributor

unit tests are failing, you can look at the error log here https://github.com/open-mmlab/mmpose/pull/212/checks?check_run_id=1305158220. you can also run pytest locally

@vsatyakumar
Copy link
Contributor Author

Thanks, fixed build errors. Is this ready to merge?

mmpose/apis/inference.py Outdated Show resolved Hide resolved
@jin-s13 jin-s13 mentioned this pull request Oct 30, 2020
@innerlee
Copy link
Contributor

Hi @vsatyakumar , we will release new version tomorrow. If the changes are quick enough, we can make this into this new version 😃

@vsatyakumar
Copy link
Contributor Author

Hi @vsatyakumar , we will release new version tomorrow. If the changes are quick enough, we can make this into this new version 😃

Pushed fixes. Hope everything looks good. Thank you!

Copy link
Collaborator

@jin-s13 jin-s13 left a comment

Choose a reason for hiding this comment

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

tests/data/smpl/test_joint_regressor.npy should not be added.

@vsatyakumar
Copy link
Contributor Author

tests/data/smpl/test_joint_regressor.npy should not be added.

Yes, fixed. Please add test files to .gitignore

@vsatyakumar
Copy link
Contributor Author

Thanks to @michalwols for feedback on improving hooks logic!

mmpose/utils/hooks.py Outdated Show resolved Hide resolved
@innerlee
Copy link
Contributor

@jin-s13 you may try this branch to see if it solves the memory issue

demo/top_down_img_demo.py Outdated Show resolved Hide resolved
@innerlee
Copy link
Contributor

Thanks!

@innerlee innerlee merged commit fb00a53 into open-mmlab:master Oct 31, 2020
wusize pushed a commit that referenced this pull request Nov 13, 2020
* Added optional support to return heatmaps and backbone features during inference of top-down pose model

* Added hooks for extracting layer outputs defined by name (and heatmap)

* Fixed docstring

* return heatmap condition fix

* Docstring fixes

* Docstring fixes

* Docstring fixes

* 'image' call fix

* Fixed linting errors

* fixed top down demo

* fixed evaluate func

* Fixed evaluate func

* Fixed json loader in tests

* Cleanup

* try catch fix

* try catch fix

* Fixed model forward_test return signature to return heatmap

* Deleted test file

* Added .npy to ignore list

* Optimized layer output hooks logic

* Decoupled heatmap from output layer names.

* Refactored mmpose.utils.hooks

* Fixed mmpose.utils.hooks

* Fixed output_layer_names default in top down demos

Co-authored-by: OWAL Admin <janderoot@owal.io>
wusize pushed a commit that referenced this pull request Nov 13, 2020
* Added optional support to return heatmaps and backbone features during inference of top-down pose model

* Added hooks for extracting layer outputs defined by name (and heatmap)

* Fixed docstring

* return heatmap condition fix

* Docstring fixes

* Docstring fixes

* Docstring fixes

* 'image' call fix

* Fixed linting errors

* fixed top down demo

* fixed evaluate func

* Fixed evaluate func

* Fixed json loader in tests

* Cleanup

* try catch fix

* try catch fix

* Fixed model forward_test return signature to return heatmap

* Deleted test file

* Added .npy to ignore list

* Optimized layer output hooks logic

* Decoupled heatmap from output layer names.

* Refactored mmpose.utils.hooks

* Fixed mmpose.utils.hooks

* Fixed output_layer_names default in top down demos

Co-authored-by: OWAL Admin <janderoot@owal.io>
wusize pushed a commit that referenced this pull request Nov 13, 2020
* Added optional support to return heatmaps and backbone features during inference of top-down pose model

* Added hooks for extracting layer outputs defined by name (and heatmap)

* Fixed docstring

* return heatmap condition fix

* Docstring fixes

* Docstring fixes

* Docstring fixes

* 'image' call fix

* Fixed linting errors

* fixed top down demo

* fixed evaluate func

* Fixed evaluate func

* Fixed json loader in tests

* Cleanup

* try catch fix

* try catch fix

* Fixed model forward_test return signature to return heatmap

* Deleted test file

* Added .npy to ignore list

* Optimized layer output hooks logic

* Decoupled heatmap from output layer names.

* Refactored mmpose.utils.hooks

* Fixed mmpose.utils.hooks

* Fixed output_layer_names default in top down demos

Co-authored-by: OWAL Admin <janderoot@owal.io>
rollingman1 pushed a commit to rollingman1/mmpose that referenced this pull request Nov 5, 2021
@OpenMMLab-Assistant-007
Copy link

Hi!
@vsatyakumar
First of all, we want to express our gratitude for your significant PR in the OpenMMLab project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR.

We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA

If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution❤

shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
* Added optional support to return heatmaps and backbone features during inference of top-down pose model

* Added hooks for extracting layer outputs defined by name (and heatmap)

* Fixed docstring

* return heatmap condition fix

* Docstring fixes

* Docstring fixes

* Docstring fixes

* 'image' call fix

* Fixed linting errors

* fixed top down demo

* fixed evaluate func

* Fixed evaluate func

* Fixed json loader in tests

* Cleanup

* try catch fix

* try catch fix

* Fixed model forward_test return signature to return heatmap

* Deleted test file

* Added .npy to ignore list

* Optimized layer output hooks logic

* Decoupled heatmap from output layer names.

* Refactored mmpose.utils.hooks

* Fixed mmpose.utils.hooks

* Fixed output_layer_names default in top down demos

Co-authored-by: OWAL Admin <janderoot@owal.io>
HAOCHENYE pushed a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
ajgrafton pushed a commit to ajgrafton/mmpose that referenced this pull request Mar 6, 2024
* Added optional support to return heatmaps and backbone features during inference of top-down pose model

* Added hooks for extracting layer outputs defined by name (and heatmap)

* Fixed docstring

* return heatmap condition fix

* Docstring fixes

* Docstring fixes

* Docstring fixes

* 'image' call fix

* Fixed linting errors

* fixed top down demo

* fixed evaluate func

* Fixed evaluate func

* Fixed json loader in tests

* Cleanup

* try catch fix

* try catch fix

* Fixed model forward_test return signature to return heatmap

* Deleted test file

* Added .npy to ignore list

* Optimized layer output hooks logic

* Decoupled heatmap from output layer names.

* Refactored mmpose.utils.hooks

* Fixed mmpose.utils.hooks

* Fixed output_layer_names default in top down demos

Co-authored-by: OWAL Admin <janderoot@owal.io>
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.

6 participants