- Notifications
You must be signed in to change notification settings - Fork45
PyTorch implementation of DeepLabv3
License
chenxi116/DeepLabv3.pytorch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a PyTorch implementation ofDeepLabv3 that aims to reuse theresnet implementation in torchvision as much as possible. This means we use thePyTorch model checkpoint when finetuning from ImageNet, instead ofthe one provided in TensorFlow.
We try to match every detail in DeepLabv3, except that Multi-Grid other than (1, 1, 1) is not yet supported. On PASCAL VOC 2012 validation set, using the same hyperparameters, we reproduce the performance reported in the paper (GPU with 16GB memory is required). We also support the combination of Group Normalization + Weight Standardization:
Implementation | Normalization | Multi-Grid | ASPP | Image Pooling | mIOU |
---|---|---|---|---|---|
Paper | BN | (1, 2, 4) | (6, 12, 18) | Yes | 77.21 |
Ours | BN | (1, 1, 1) | (6, 12, 18) | Yes | 76.49 |
Ours | GN+WS | (1, 1, 1) | (6, 12, 18) | Yes | 77.20 |
To run the BN experiment, after preparing the dataset as follows, simply run:
python main.py --train --exp bn_lr7e-3 --epochs 50 --base_lr 0.007
To test the trained model, use the same command except delete--train
. To use our trained model (76.49):
wget https://cs.jhu.edu/~cxliu/data/deeplab_resnet101_pascal_v3_bn_lr7e-3_epoch50.pth -P data/
To run the GN+WS experiment, begin by downloading the GN+WS ResNet101 trained on ImageNet:
wget https://cs.jhu.edu/~syqiao/WeightStandardization/R-101-GN-WS.pth.tar -P data/python main.py --train --exp gn_ws_lr7e-3 --epochs 50 --base_lr 0.007 --groups 32 --weight_std
Again, to test the trained model, use the same command except delete--train
. To use our trained model (77.20):
wget https://cs.jhu.edu/~cxliu/data/deeplab_resnet101_pascal_v3_gn_ws_lr7e-3_epoch50.pth -P data/
mkdir datacd datawget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tartar -xf VOCtrainval_11-May-2012.tarcd VOCdevkit/VOC2012/wget http://cs.jhu.edu/~cxliu/data/SegmentationClassAug.zipwget http://cs.jhu.edu/~cxliu/data/SegmentationClassAug_Visualization.zipwget http://cs.jhu.edu/~cxliu/data/list.zipunzip SegmentationClassAug.zipunzip SegmentationClassAug_Visualization.zipunzip list.zip
unzip leftImg8bit_trainvaltest.zipunzip gtFine_trainvaltest.zipgit clone https://github.com/mcordts/cityscapesScripts.gitmv cityscapesScripts/cityscapesscripts ./rm -rf cityscapesScriptspython cityscapesscripts/preparation/createTrainIdLabelImgs.py
About
PyTorch implementation of DeepLabv3
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.