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

[Refactor] Support TTA #2184

Merged
merged 20 commits into from Dec 30, 2022
Merged

[Refactor] Support TTA #2184

merged 20 commits into from Dec 30, 2022

Conversation

xiexinch
Copy link
Collaborator

@xiexinch xiexinch commented Oct 13, 2022

Motivation

Support Test Time Augmentation.

Based on open-mmlab/mmengine#611

Modification

  • Add EncoderDecoderTTA
  • Add softmax to the post _process method at BaseSegmentor

Use cases (Optional)

Test a model with TTA:

# Single GPU
python tools/test.py {CONFIG} {CKPT} --tta

# Multi GPUs
./tools/dist_test.sh {CONFIG} {CKPT} {NUM_GPUS} --tta

@xiexinch xiexinch changed the title Refactor TTA [Draft] Refactor TTA Oct 13, 2022
@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 83.33% // Head: 83.41% // Increases project coverage by +0.07% 🎉

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

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2184      +/-   ##
===========================================
+ Coverage    83.33%   83.41%   +0.07%     
===========================================
  Files          143      144       +1     
  Lines         8127     8159      +32     
  Branches      1211     1218       +7     
===========================================
+ Hits          6773     6806      +33     
+ Misses        1165     1164       -1     
  Partials       189      189              
Flag Coverage Δ
unittests 83.41% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
mmseg/models/segmentors/__init__.py 100.00% <100.00%> (ø)
mmseg/models/segmentors/base.py 90.14% <100.00%> (+2.26%) ⬆️
mmseg/models/segmentors/seg_tta.py 100.00% <100.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 added this to the 2.0.0rc2 milestone Oct 31, 2022
@MeowZheng MeowZheng added the 1.x Related issue of 1.x version label Nov 1, 2022
@MeowZheng MeowZheng deleted the branch open-mmlab:dev-1.x November 2, 2022 10:34
@MeowZheng MeowZheng closed this Nov 2, 2022
@MeowZheng MeowZheng reopened this Nov 2, 2022
@xiexinch xiexinch marked this pull request as ready for review November 19, 2022 09:18
@xiexinch xiexinch changed the title [Draft] Refactor TTA [Refactor] Support TTA Nov 19, 2022
@xiexinch
Copy link
Collaborator Author

@MeowZheng,
Could you preview this PR if you're available? I'll update the unit test soon.

Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

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

It looks good to me, and please add ut

@MeowZheng MeowZheng merged commit 6773800 into open-mmlab:dev-1.x Dec 30, 2022
MeowZheng pushed a commit to MeowZheng/mmsegmentation that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
MeowZheng pushed a commit to MeowZheng/mmsegmentation that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
MeowZheng pushed a commit to MeowZheng/mmsegmentation that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
MeowZheng pushed a commit that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
MeowZheng pushed a commit that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
MeowZheng pushed a commit that referenced this pull request Dec 30, 2022
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* Quality check and adding tokenizer

* Adapted stable diffusion to mixed precision+finished up style fixes

* Fixed based on patrick's review

* Fixed oom from number of validation images

* Removed unnecessary np.array conversion

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this pull request Dec 3, 2023
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x Related issue of 1.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants