Skip to content

Conversation

@siddancha
Copy link
Contributor

Motivation

This is motivated by a previously unfinished PR (#2332). In that PR, the label -1 was changed to 255 in BaseSegDataset, which is correct. However, it was changed at only one location. There is another location in mmseg/datasets/basesegdataset.py where -1 was still being used that was not converted to 255. I have now converted it to 255.

This is exactly same as a similar fix to the master branch via #2515 .

Modification

I've simply converted the snipped

if new_id != -1:
    new_palette.append(palette[old_id])

to

if new_id != 255:
    new_palette.append(palette[old_id])

Checklist

  • Pre-commit or other linting tools are used to fix the potential lint issues.
    • I've fixed all linting/pre-commit errors.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
    • _No unit tests need to be added or were affected.
  • If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D.
    • I don't think this change affects MMDet or MMDet3D.
  • The documentation has been modified accordingly, like docstring or example tutorials.
    • This change fixes an existing bug and doesn't require modifying any documentation/docstring.

@siddancha siddancha marked this pull request as ready for review January 28, 2023 04:01
@siddancha siddancha changed the title Perform unfinished label conversion from -1 to 255 in 1.x [Fix] Unfinished label conversion from -1 to 255 in 1.x Jan 28, 2023
@MeowZheng
Copy link
Collaborator

This modification looks good to me, and the ci failed probably because upstream repos mmdet or mmengine did some backward incompatible changes, and we are working on fix it.

@MeowZheng
Copy link
Collaborator

we have fixed ci problem in #2519 and please rebase the modification on it. :)

@siddancha
Copy link
Contributor Author

Great! Merged the latest version of dev-1.x.

@MeowZheng MeowZheng mentioned this pull request Jan 30, 2023
@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Base: 83.39% // Head: 83.40% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (e236cce) compared to base (b9b5d8b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2516      +/-   ##
===========================================
+ Coverage    83.39%   83.40%   +0.01%     
===========================================
  Files          145      145              
  Lines         8510     8510              
  Branches      1274     1274              
===========================================
+ Hits          7097     7098       +1     
  Misses        1198     1198              
+ Partials       215      214       -1     
Flag Coverage Δ
unittests 83.40% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
mmseg/datasets/basesegdataset.py 100.00% <100.00%> (+1.02%) ⬆️
mmseg/datasets/transforms/transforms.py 90.40% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MeowZheng MeowZheng merged commit d1c0a3e into open-mmlab:dev-1.x Jan 30, 2023
@siddancha siddancha deleted the sid/pr/replace-minus-one-label-with-255-1.x branch January 30, 2023 04:54
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
…n-mmlab#2516)

* add a documentation page for evaluating diffuion models.

* fix: checkpoint link.

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <[email protected]>
Co-authored-by: Kashif Rasul <[email protected]>

* formatting fixes.

* formatting fixes.

* link to partiprompts dataset on hub.

* reflect on Pedro's comments.

Co-authored-by: Pedro <[email protected]>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <[email protected]>

* reflect on Pedro's comments.

Co-authored-by: Pedro <[email protected]>

* update mention of FID.

* Apply suggestions from code review

Co-authored-by: Will Berman <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>

* minor nit.

* finish edges and add colab notebook.

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <[email protected]>

* run formatting.

* additional feedback.

---------

Co-authored-by: Patrick von Platen <[email protected]>
Co-authored-by: Kashif Rasul <[email protected]>
Co-authored-by: Pedro <[email protected]>
Co-authored-by: Will Berman <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
…ab#2516)

## Motivation

This is motivated by a previously unfinished PR (open-mmlab#2332). In that PR, the
label -1 was changed to 255 in `BaseSegDataset`, which is correct.
However, it was changed at only one location. There is another location
in `mmseg/datasets/basesegdataset.py` where -1 was still being used that
was not converted to 255. I have now converted it to 255.

This is exactly same as a similar fix to the `master` branch via open-mmlab#2515 .

## Modification

I've simply converted the snipped

```python
if new_id != -1:
    new_palette.append(palette[old_id])
```
to 
```python
if new_id != 255:
    new_palette.append(palette[old_id])
```

## Checklist

- [x] Pre-commit or other linting tools are used to fix the potential
lint issues.
  - _I've fixed all linting/pre-commit errors._
- [x] The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
  - _No unit tests need to be added or were affected.
- [x] If the modification has potential influence on downstream
projects, this PR should be tested with downstream projects, like MMDet
or MMDet3D.
  - _I don't think this change affects MMDet or MMDet3D._
- [x] The documentation has been modified accordingly, like docstring or
example tutorials.
- _This change fixes an existing bug and doesn't require modifying any
documentation/docstring._
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.

4 participants