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 SFSegNet head #733

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

Conversation

MengzhangLI
Copy link
Contributor

@MengzhangLI MengzhangLI commented Jul 27, 2021

Implementation of Semantic Flow for Fast and Accurate SceneParsing.
Modified from the official repository.

Done:

  • unitest

Todo:

  • design the config interface and files
  • more experiments especially model with res18 backbone.

Related re-implementation https://github.com/azxj/SFNet.

@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #733 (8323699) into master (6526593) will increase coverage by 0.25%.
The diff coverage is 98.00%.

❗ Current head 8323699 differs from pull request most recent head 12def7c. Consider uploading reports for the commit 12def7c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #733      +/-   ##
==========================================
+ Coverage   85.28%   85.54%   +0.25%     
==========================================
  Files         107      108       +1     
  Lines        5817     5906      +89     
  Branches      952      957       +5     
==========================================
+ Hits         4961     5052      +91     
  Misses        673      673              
+ Partials      183      181       -2     
Flag Coverage Δ
unittests 85.54% <98.00%> (+0.27%) ⬆️

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

Impacted Files Coverage Δ
mmseg/models/backbones/resnet.py 99.28% <ø> (ø)
mmseg/models/backbones/swin.py 86.89% <66.66%> (ø)
mmseg/models/necks/fpn.py 54.54% <66.66%> (+0.59%) ⬆️
mmseg/models/backbones/unet.py 94.91% <100.00%> (+0.04%) ⬆️
mmseg/models/backbones/vit.py 84.84% <100.00%> (ø)
mmseg/models/builder.py 92.00% <100.00%> (+0.69%) ⬆️
mmseg/models/decode_heads/__init__.py 100.00% <100.00%> (ø)
mmseg/models/decode_heads/fpn_head.py 100.00% <100.00%> (ø)
mmseg/models/decode_heads/setr_mla_head.py 100.00% <100.00%> (ø)
mmseg/models/decode_heads/setr_up_head.py 100.00% <100.00%> (ø)
... and 6 more

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 6526593...12def7c. Read the comment docs.

mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
mmseg/models/decode_heads/sfnet_head.py Outdated Show resolved Hide resolved
@Junjun2016
Copy link
Collaborator

Hi @MengzhangLI
Please resolve the comments.

@Junjun2016
Copy link
Collaborator

Junjun2016 commented Jul 27, 2021

Hi @MengzhangLI
For every PR, you should checkout to the master first, then pull the upstream master, and finally checkout a new branch.
It can avoid too many unnecessary commit histories.

@MengzhangLI MengzhangLI added the WIP Work in process label Aug 3, 2021
@MengzhangLI
Copy link
Contributor Author

Re-implementing SFNet ResNet50 of PaddleSeg.

Inference metric is done.
image

Note:
stride in model of paddleseg sfnet Res50 is (1, 2, 1, 1), where original paper is (1, 2, 2, 2)
That's why the performance of its sfnet res50 81.49 is better than paper 80.74.

@MengzhangLI
Copy link
Contributor Author

Re-implementing SFNet ResNet18 of PaddleSeg.

Note: there are some potential risks for paddleseg users:
(1) Actual Output Stride(OS) of Paddleseg SFNet ResNet18 model is not 8 but 32. Although 32 is setting of original paper, It is unintentionally correct settings because paddleseg setting is 8 from here

The reason of OS = 32 is when building backbone models, paddleseg would skip dilation rate from here when layers <= 50.

Thus, stride of SFNet of Paddleseg are (1, 2, 1, 1), os = 8 (Res50) and (1, 2, 2, 2), os = 32 (Res18), respectively.

(2) When using ResNetv1d with 18 layers, paddleseg would add a short downsample operations (conv + BN) at first layer, where official usage (mmsegmentation adopted) would not add. Thus it would have five more variables:
backbone.bb_0_0.short._conv.weight (64, 64, 1, 1)
backbone.bb_0_0.short._batch_norm.weight (64,)
backbone.bb_0_0.short._batch_norm.bias (64,)
backbone.bb_0_0.short._batch_norm._mean (64,)
backbone.bb_0_0.short._batch_norm._variance (64,)

Anyway, inference metric is DONE.

image

@MengzhangLI MengzhangLI mentioned this pull request Aug 12, 2021
@MengzhangLI
Copy link
Contributor Author

Related SFNet model: https://github.com/azxj/SFNet

@jyang68sh
Copy link

jyang68sh commented Feb 21, 2022

Hi I just runned sfnet_r18-d32_512x1024_80k_cityscapes.py and only get mIoU of 73.92. I am wondering the cause. Did you change the config?

@MengzhangLI

+-------+-------+-------+ | aAcc | mIoU | mAcc | +-------+-------+-------+ | 95.49 | 73.92 | 81.48 | +-------+-------+-------+

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* up

* uP

* uP

* make style

* Apply suggestions from code review

* up

* finish
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
Replace message with empty backquotes.

This was part of open-mmlab#733, I was too slow to review :)
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this pull request Dec 3, 2023
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
* base cn data preparation

* half sthv1

* sth

* move

* ucf101_24

* jhmdb hald-anet

* another hald-anet

* fix

* polish

* polish

* polish

* polish

* polish

* polish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants