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

Add support for Pascal Context 59 classes #459

Merged
merged 12 commits into from
Apr 20, 2021
Merged

Conversation

clownrat6
Copy link
Contributor

@clownrat6 clownrat6 commented Apr 8, 2021

  • Create PascalContextDataset59 class in mmseg/datasets/pascal_context.py;

  • Set reduce_zero_label=True for train_pipeline and PascalContextDataset59;

  • Add some configs for Pascal-Context 59 classes training and testing;

All evaluations are conducted after PR #471.

This table aims at checking the correctness of pascal context 59 dataset support.

model test repo num classes Lr schd mIoU mIoU(ms+flip)
HRNetV2-W48(author) mmsegmentation 59 - 51.7 53.92
HRNetV2-W48(author) mmsegmentation 60 - 46.18 48.02
HRNetV2-W48(author) raw 59 - 52.25 54.1
HRNetV2-W48(author) raw 60 - 46.96 48.3
HRNetV2-W48(new) mmsegmentation 59 40000 50.37 52.88
HRNetV2-W48(new) mmsegmentation 60 40000 45.55 47.7
HRNetV2-W48(new) mmsegmentation 59 80000 51.12 53.56
HRNetV2-W48(new mmsegmentation 60 80000 45.79 47.86
HRNetV2-W48(old) mmsegmentation 60 40000 45.14 47.42

This table is the training and evaluation collection.

model num classes Lr schd mIoU mIoU(ms+flip)
DeepLabV3+_R-101-D8 59 40000 52.86 54.54
DeepLabV3+_R-101-D8 59 80000 53.2 54.67
DeepLabV3_R-101-D8 59 40000 52.61 54.28
DeepLabV3_R-101-D8 59 80000 52.46 54.09
PSPNet_R-101-D8 59 40000 52.02 53.54
PSPNet_R-101-D8 59 80000 52.47 53.99
HRNetV2-W48 59 40000 50.33 52.83
HRNetV2-W48 59 80000 51.12 53.56
FCN_R-101-D8 59 40000 48.42 50.4
FCN_R-101-D8 59 80000 49.35 51.38

How to use HRNetV2-W48 official weights to test on our repo?

ps: testing on pascal context dataset
  1. Download HRNetV2-W48 official weights 59 classes and 69 classes. (You'd better download them in master branch of official repo)
  2. Then, using the convert script to convert official weights to pytorch style:
python tools/scripts/convert_hrnet.py [src_path] [dst_path]
  1. In order to match the inference process, modify codes according to this commit.
  2. Then, using hrnet config to test model on pascal context dataset:
python -u tools/test.py [config path] [converted official weights path] --eval mIoU

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2021

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #459 (a768991) into master (1483720) will decrease coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
- Coverage   86.51%   86.48%   -0.03%     
==========================================
  Files          97       97              
  Lines        4967     4974       +7     
  Branches      806      807       +1     
==========================================
+ Hits         4297     4302       +5     
- Misses        517      519       +2     
  Partials      153      153              
Flag Coverage Δ
unittests 86.48% <77.77%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
mmseg/datasets/pascal_context.py 76.47% <75.00%> (-3.53%) ⬇️
mmseg/datasets/__init__.py 100.00% <100.00%> (ø)

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 1483720...a768991. Read the comment docs.

@clownrat6 clownrat6 changed the title add some pascal context 59 classes configs Add support for Pascal Context 59 classes Apr 8, 2021
* Create PascalContextDataset59 class in mmseg/datasets/pascal_context.py;

* Set reduce_zero_label=True for train_pipeline and PascalContextDataset59;

* Add some configs for Pascal-Context 59 classes training and testing;
intersect.float(), bins=(num_classes), min=0, max=num_classes)
intersect.float(), bins=num_classes, min=0, max=num_classes - 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need to test whether the results are consistent for other models.
We could make another PR for this modification, we may also include impact range in the new PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We may merge master and resolve conflicts.

sennnnn added 2 commits April 16, 2021 11:00
…training based on PascalContextDataset59;

Add some ignore items in ".gitignore";
.gitignore Outdated Show resolved Hide resolved
sennnnn added 2 commits April 19, 2021 16:57
* Add weighs link, config link, log link and evaluation results about PascalContextDataset59 in README.md
…nsmit port when you transmit data to distributed machine.
@xvjiarui
Copy link
Collaborator

Please merge master to resolve the conflicts.

@xvjiarui
Copy link
Collaborator

We may delete unused configs.

tools/test.py Outdated Show resolved Hide resolved
@clownrat6 clownrat6 force-pushed the debug branch 2 times, most recently from 1c5a7eb to d463783 Compare April 20, 2021 02:11
* Remove "-p|--port" command argument;
@xvjiarui xvjiarui merged commit 83d312e into open-mmlab:master Apr 20, 2021
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* Add support for Pascal Context 59 classes (open-mmlab#459)

* Create PascalContextDataset59 class in mmseg/datasets/pascal_context.py;

* Set reduce_zero_label=True for train_pipeline and PascalContextDataset59;

* Add some configs for Pascal-Context 59 classes training and testing;

* Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* Continue(1): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* ignore files and folders named tempxxx;

* Continue(2): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* Modify the calculation of IoU;

* Modify the CLASSES order of PascalContextDataset;

* Add "fcn", "deeplabv3", "deeplabv3+", "pspnet" config file for model training based on PascalContextDataset59;

Add some ignore items in ".gitignore";

* fix the bug "test_cfg specified in both outer field and model field " of pspnet config file;

* * Clean unnecessary codes;

* Add weighs link, config link, log link and evaluation results about PascalContextDataset59 in README.md

* Add command line argument: "-p | --port", this arg can change the transmit port when you transmit data to distributed machine.

* * Remove rebundant config files;

* Remove "-p|--port" command argument;

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
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