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] Refactor Resize transform and add Pad transform. #506

Merged
merged 7 commits into from
Nov 10, 2021

Conversation

0x4f5da2
Copy link
Contributor

@0x4f5da2 0x4f5da2 commented Nov 1, 2021

Motivation

This pull request is base on issue#453

Modification

Refactor the Resize to enable resizing images while keeping the aspect ratio with padding.

@0x4f5da2 0x4f5da2 changed the title [WIP] Refactor resize, [WIP] refactor resize Nov 1, 2021
@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Merging #506 (98cacde) into master (72cffac) will increase coverage by 0.19%.
The diff coverage is 97.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   79.42%   79.62%   +0.19%     
==========================================
  Files         106      106              
  Lines        5959     6002      +43     
  Branches      962      972      +10     
==========================================
+ Hits         4733     4779      +46     
+ Misses       1095     1093       -2     
+ Partials      131      130       -1     
Flag Coverage Δ
unittests 79.62% <97.43%> (+0.19%) ⬆️

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

Impacted Files Coverage Δ
mmcls/datasets/pipelines/transforms.py 88.17% <97.36%> (+1.36%) ⬆️
mmcls/datasets/pipelines/__init__.py 100.00% <100.00%> (ø)
mmcls/utils/logger.py 100.00% <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 72cffac...98cacde. Read the comment docs.

@0x4f5da2 0x4f5da2 removed the WIP label Nov 4, 2021
@0x4f5da2 0x4f5da2 changed the title [WIP] refactor resize refactor resize Nov 4, 2021
@0x4f5da2 0x4f5da2 marked this pull request as ready for review November 4, 2021 10:53
@0x4f5da2 0x4f5da2 requested a review from mzr1996 November 4, 2021 11:28
mmcls/datasets/pipelines/transforms.py Outdated Show resolved Hide resolved
mmcls/datasets/pipelines/transforms.py Outdated Show resolved Hide resolved
@mzr1996 mzr1996 changed the title refactor resize [Refactor] Refactor Resize transform and add Pad transform. Nov 5, 2021
mmcls/datasets/pipelines/transforms.py Outdated Show resolved Hide resolved
mmcls/datasets/pipelines/transforms.py Outdated Show resolved Hide resolved
mmcls/datasets/pipelines/transforms.py Outdated Show resolved Hide resolved
tests/test_data/test_pipelines/test_transform.py Outdated Show resolved Hide resolved
@mzr1996 mzr1996 linked an issue Nov 9, 2021 that may be closed by this pull request
@0x4f5da2 0x4f5da2 requested a review from mzr1996 November 10, 2021 02:36
Copy link
Member

@mzr1996 mzr1996 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 9ab9d4f into open-mmlab:master Nov 10, 2021
mzr1996 pushed a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
…-mmlab#506)

* refactor resize, test tobe done

* resize reimpl according to discussion; add pad

* minor fixes and add tests

* minor fixes on docstring

* add additional unit test

* reformat resize and pad

* revise code and docstr according to the comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resize maintaining aspect ratio
2 participants