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

[Feature] Add Rerange transform #228

Merged
merged 7 commits into from
Nov 10, 2020
Merged

[Feature] Add Rerange transform #228

merged 7 commits into from
Nov 10, 2020

Conversation

yamengxi
Copy link
Collaborator

@yamengxi yamengxi commented Nov 4, 2020

No description provided.

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #228 (49423ed) into master (7c68bca) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Flag Coverage Δ
unittests 84.43% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
mmseg/datasets/pipelines/transforms.py 96.83% <100.00%> (+0.22%) ⬆️

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 7c68bca...982e3e9. Read the comment docs.

Comment on lines 431 to 432
results['img_rerange_cfg'] = dict(
min_value=self.min_value, max_value=self.max_value)
Copy link
Collaborator

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?

@hellock
Copy link
Member

hellock commented Nov 9, 2020

Task linked: CU-fjrgpn Data preprocessing

results (dict): Result dict from loading pipeline.

Returns:
dict: Reranged results, 'img_rerange_cfg' key is added into
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not updated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I forget it!

Comment on lines 423 to 426
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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@xvjiarui xvjiarui merged commit 2bd51e6 into open-mmlab:master Nov 10, 2020
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* add rerange transform

* restore

* delete rerange config

* delete rerange config hint

* add min < max assert

* restore
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