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

[Fix] Fix the bug of large seg map IoU calculation #534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sennnnn
Copy link
Contributor

@sennnnn sennnnn commented May 8, 2021

This PR is realated to #523.

Problem statement

torch.histc may meet a trouble when inputting large size seg map. torch.histc may only be able to count 2^24. When pixels of single class exceed 2^24, torch.histc can't count exceeded part.

Fix

We change torch.histc to torch.bincount when counting pixels of each class.

Others

torch.bincount can only support 1-d non-negative integral inputs. Besides, the inference speed of torch.bincount is slower than torch.histc

@codecov
Copy link

codecov bot commented May 8, 2021

Codecov Report

Merging #534 (7bfc804) into master (db44d16) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #534   +/-   ##
=======================================
  Coverage   86.79%   86.80%           
=======================================
  Files         101      101           
  Lines        5249     5252    +3     
  Branches      848      848           
=======================================
+ Hits         4556     4559    +3     
  Misses        533      533           
  Partials      160      160           
Flag Coverage Δ
unittests 86.80% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
mmseg/core/evaluation/metrics.py 89.65% <100.00%> (+0.36%) ⬆️

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 db44d16...7bfc804. Read the comment docs.

@sennnnn sennnnn requested a review from xvjiarui May 9, 2021 05:43
@sennnnn sennnnn changed the title [fix] fix the bug of large seg map IoU calculation [Fix] Fix the bug of large seg map IoU calculation May 11, 2021
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* pytorch only schedulers

* fix style

* remove match_shape

* pytorch only ddpm

* remove SchedulerMixin

* remove numpy from karras_ve

* fix types

* remove numpy from lms_discrete

* remove numpy from pndm

* fix typo

* remove mixin and numpy from sde_vp and ve

* remove remaining tensor_format

* fix style

* sigmas has to be torch tensor

* removed set_format in readme

* remove set format from docs

* remove set_format from pipelines

* update tests

* fix typo

* continue to use mixin

* fix imports

* removed unsed imports

* match shape instead of assuming image shapes

* remove import typo

* update call to add_noise

* use math instead of numpy

* fix t_index

* removed commented out numpy tests

* timesteps needs to be discrete

* cast timesteps to int in flax scheduler too

* fix device mismatch issue

* small fix

* Update src/diffusers/schedulers/scheduling_pndm.py

Co-authored-by: Patrick von Platen <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


sennnnn seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

None yet

2 participants