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

[Fix] Fix a visualization bug and refine dataset browser #1668

Merged
merged 6 commits into from
Sep 23, 2022

Conversation

Ben-Louis
Copy link
Collaborator

Motivation

Modification

  1. fix a bug about visualizer's dataset_meta.
    When testing with multiple GPUs, there are multiple processes but only one visualizer. The visualizer.dataset_meta is manually set to None occasionally in some processes in test_loop. This may lead to AttributeError in other processes when getting items from visualizer.dataset_meta.
  2. refine dataset browser
    • use file_client to read image instead of mmcv.imread
    • keep bbox_file in dataset configs. Thus the visualization results match the images model receives indeed.

BC-breaking (Optional)

Use cases (Optional)

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@ly015
Copy link
Member

ly015 commented Sep 19, 2022

from __future__ import annotations may have compatibility issues on python 3.6. Please consider using a string like 'BufferManager' for type hints within the class itself.

@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Base: 70.34% // Head: 70.37% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (3edf57d) compared to base (60c62fc).
Patch coverage: 69.23% of modified lines in pull request are covered.

❗ Current head 3edf57d differs from pull request most recent head 7f1e8cb. Consider uploading reports for the commit 7f1e8cb to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #1668      +/-   ##
===========================================
+ Coverage    70.34%   70.37%   +0.03%     
===========================================
  Files          203      203              
  Lines        11558    11564       +6     
  Branches      2019     2021       +2     
===========================================
+ Hits          8130     8138       +8     
+ Misses        3083     3078       -5     
- Partials       345      348       +3     
Flag Coverage Δ
unittests 70.37% <69.23%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
mmpose/apis/webcam/utils/buffer.py 0.00% <0.00%> (ø)
mmpose/engine/hooks/visualization_hook.py 75.40% <75.00%> (-0.46%) ⬇️
mmpose/visualization/local_visualizer.py 72.39% <75.00%> (-0.74%) ⬇️
mmpose/datasets/transforms/common_transforms.py 83.19% <0.00%> (ø)
mmpose/codecs/utils/refinement.py 98.52% <0.00%> (+1.47%) ⬆️
mmpose/structures/utils.py 32.55% <0.00%> (+9.30%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Ben-Louis
Copy link
Collaborator Author

from __future__ import annotations may have compatibility issues on python 3.6. Please consider using a string like 'BufferManager' for type hints within the class itself.

Solved. The corresponding unittest is add in #1662

tools/misc/browse_dataset.py Outdated Show resolved Hide resolved
@ly015 ly015 merged commit 86167d0 into open-mmlab:dev-1.x Sep 23, 2022
ly015 pushed a commit that referenced this pull request Oct 14, 2022
* fix visualizer's dataset_meta error in visualization_hook with multiple GPUs

* refine dataset browser

* use string typehint for compatibility with python3.6

* update unittest for visualizer and visulization_hook

* refine visualizer to avoid saving duplicated images with visualization_hook

* refine dataset browser
ly015 pushed a commit that referenced this pull request Oct 14, 2022
* fix visualizer's dataset_meta error in visualization_hook with multiple GPUs

* refine dataset browser

* use string typehint for compatibility with python3.6

* update unittest for visualizer and visulization_hook

* refine visualizer to avoid saving duplicated images with visualization_hook

* refine dataset browser
@Ben-Louis Ben-Louis deleted the fix-visualization-bugs branch November 15, 2022 08:42
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
…1668)

* fix visualizer's dataset_meta error in visualization_hook with multiple GPUs

* refine dataset browser

* use string typehint for compatibility with python3.6

* update unittest for visualizer and visulization_hook

* refine visualizer to avoid saving duplicated images with visualization_hook

* refine dataset browser
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.

2 participants