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

[Refactor] Use new API of matplotlib to handle blocking input in visualization. #568

Merged
merged 2 commits into from
Dec 2, 2021

Conversation

mzr1996
Copy link
Member

@mzr1996 mzr1996 commented Nov 30, 2021

Motivation

In matplotlib 3.5, the matplotlib.blocking_input module has been deprecated, which refers to this link.
Closing #566.

Modification

  • As the title.
  • And add a return value to BaseFigureContextManager.wait_continue() to indicate whether the user presses the continue key or closes the figure.
  • In tools/visualizations/vis_pipeline.py, the progress will be interrupted if the user closes the show figure.

BC-breaking (Optional)

If users use the return value of ImshowInfosContextManager.put_img_infos, they need a small modification, from

img = manager.put_img_infos(img, {'info': 'text'})

to

_, img = manager.put_img_infos(img, {'info': 'text'})

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • CLA has been signed and all committers have signed the CLA in this PR.

@mzr1996 mzr1996 requested a review from Ezra-Yu November 30, 2021 08:43
@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #568 (84328e6) into master (00700d5) will decrease coverage by 0.05%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
- Coverage   79.92%   79.86%   -0.06%     
==========================================
  Files         107      107              
  Lines        6102     6100       -2     
  Branches     1040     1042       +2     
==========================================
- Hits         4877     4872       -5     
- Misses       1093     1094       +1     
- Partials      132      134       +2     
Flag Coverage Δ
unittests 79.86% <90.47%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
mmcls/core/visualization/image.py 86.32% <90.47%> (-2.76%) ⬇️

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 00700d5...84328e6. Read the comment docs.

Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

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

LGTM.

@mzr1996 mzr1996 merged commit 78d6d85 into open-mmlab:master Dec 2, 2021
mzr1996 added a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
…alization. (open-mmlab#568)

* [Refactor] Use new API of matplotlib to handle blocking input in
visualization.

* Modify unit tests
@mzr1996 mzr1996 deleted the better-vis branch December 7, 2022 02:08
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

2 participants