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

[Features] Load optical flow data from bytes #1362

Merged
merged 7 commits into from
Sep 23, 2021

Conversation

MeowZheng
Copy link
Collaborator

@MeowZheng MeowZheng commented Sep 22, 2021

Motivation

To support optical flow data loading from different storage platforms, I implement two functions to decode optical flow from bytes.

Modification

  1. Add flow_from_bytes and sparse_flow_from_bytes functions in mmcv/video/optflow.py
  2. Revise mmcv/video/__init__.py
  3. Add unit test in tests/test_video/test_optflow.py

BC-breaking (Optional)

no

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 test to ensure the correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

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

Copy link
Collaborator

@zhouzaida zhouzaida left a comment

Choose a reason for hiding this comment

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

LGTM

@ZwwWayne
Copy link
Collaborator

Last comment: the tests/data/sparse_flow.png is a little big, better to compress it to a size smaller than 100KB.

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #1362 (2525b5f) into master (4bab292) will decrease coverage by 0.06%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1362      +/-   ##
==========================================
- Coverage   69.14%   69.07%   -0.07%     
==========================================
  Files         162      162              
  Lines       10746    10776      +30     
  Branches     1978     1983       +5     
==========================================
+ Hits         7430     7444      +14     
- Misses       2927     2940      +13     
- Partials      389      392       +3     
Flag Coverage Δ
unittests 69.07% <88.23%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
mmcv/video/optflow.py 96.07% <87.50%> (-1.60%) ⬇️
mmcv/video/__init__.py 100.00% <100.00%> (ø)
mmcv/ops/pixel_group.py 72.72% <0.00%> (-27.28%) ⬇️
mmcv/ops/contour_expand.py 75.00% <0.00%> (-25.00%) ⬇️
mmcv/utils/ext_loader.py 35.89% <0.00%> (ø)

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 4bab292...2525b5f. Read the comment docs.

@ZwwWayne ZwwWayne merged commit 324e9f1 into open-mmlab:master Sep 23, 2021
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.

3 participants