-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add CropLike #299
Add CropLike #299
Conversation
Codecov Report
@@ Coverage Diff @@
## master #299 +/- ##
==========================================
+ Coverage 80.54% 80.65% +0.10%
==========================================
Files 162 162
Lines 8091 8110 +19
Branches 1192 1193 +1
==========================================
+ Hits 6517 6541 +24
+ Misses 1429 1425 -4
+ Partials 145 144 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
mmedit/datasets/pipelines/crop.py
Outdated
Modify the size of image by cropping or padding. Align upper-left. | ||
|
||
Args: | ||
target_key (str): The target key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a "target key"?
mmedit/datasets/pipelines/crop.py
Outdated
|
||
The priority of getting 'target size' is: | ||
1, results[source_key].shape | ||
2, target_size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note for the required, added and modified keys.
mmedit/datasets/pipelines/crop.py
Outdated
|
||
|
||
@PIPELINES.register_module() | ||
class ModifySize: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random thought: how about rename it to "TopLeftCrop"?
mmedit/datasets/pipelines/crop.py
Outdated
@@ -1,5 +1,6 @@ | |||
import mmcv | |||
import numpy as np | |||
from PIL.Image import NONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this
mmedit/datasets/pipelines/crop.py
Outdated
|
||
@PIPELINES.register_module() | ||
class CropLike: | ||
"""Crop/pad a key according to the size of another key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crop/pad the image in the target_key according to the size of image in the reference_key .
return results | ||
|
||
def __repr__(self): | ||
return (self.__class__.__name__ + f' target_key={self.target_key}, ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (f'{self.__class__.__name__} target_key={self.target_key}, '
f'reference_key={self.reference_key}')
* add ModifySize * Rename * Rename and fix * tiny fix Co-authored-by: liyinshuo <[email protected]>
No description provided.