-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Feature] Add Rerange transform #228
Conversation
Codecov Report
@@ Coverage Diff @@
## master #228 +/- ##
==========================================
+ Coverage 84.35% 84.43% +0.07%
==========================================
Files 90 90
Lines 4340 4361 +21
Branches 687 688 +1
==========================================
+ Hits 3661 3682 +21
Misses 537 537
Partials 142 142
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
results['img_rerange_cfg'] = dict( | ||
min_value=self.min_value, max_value=self.max_value) |
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's the purpose of img_rerange_cfg
?
Task linked: CU-fjrgpn Data preprocessing |
results (dict): Result dict from loading pipeline. | ||
|
||
Returns: | ||
dict: Reranged results, 'img_rerange_cfg' key is added into |
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.
Not updated
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.
Sorry, I forget it!
img_min_value = np.min(img) | ||
img_max_value = np.max(img) | ||
# rerange to [0, 1] | ||
img = (img - img_min_value) / (img_max_value - img_min_value) |
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.
If we are reading an image with range [0.1, 1] (no pixel is black), 0.1 will be mapped to min_value
(default 0), which is not ideal.
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.
That's exactly what it's going to do.
* add rerange transform * restore * delete rerange config * delete rerange config hint * add min < max assert * restore
No description provided.