Skip to content

ImportPaddle/APCNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Pyramid Context Network for Semantic Segmentation

##Easy to Run

AI Studio Link @PaddlePaddle

ackbone Resnet101_v1c
Decode Head APCHead
Auxiliary Head FCNHead

source

Environment

#torch 1.8.0
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
pip install prettytable
#paddle
python -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple

Pretrained model:

#mmcv resnet101_v1c  mmcv/model_zoo/open_mmlab.json:
"resnet101_v1c": "https://download.openmmlab.com/pretrain/third_party/resnet101_v1c-e67eebb6.pth"

Weight tranpose:

###模型,日志,项目下载:

cd paddle_apcnet/architectures
cp apcnetxxx_torch.pth paddle_apcnet/architectures/pretrained/apcnetxxx_torch.pth
python torchModel2pdModel.py #generate apcnetxxx_paddle.pdparams

Ai studio

百度网盘 提取码: ttqw

模型对齐:参考./check/modelCheck 以及paddle_apcnet/architectures下的 参数转化文件,以及转换结果文件

loss对齐:参考./check/ 下的 lossCheck.py

miou对齐:参考./check/ 下的 metricCheck.py

训练对齐: 参考下载链接中的日志文件

Dataset:

Cityscapes:

gtFine 5000

  1. Downdown to ./dataset

  2. sh prepare.sh

  3. cd cityscapesscripts/preparation

  4. python createTrainIdLabelImgs.py

Train:

Paddle:

cd paddle_apcnet
sh paddle.sh

Torch:

cd torch_apcnet
sh torch.sh

Test:

Paddle:

cd paddle_apcnet
python test.py

Measure:

直接跑apcnet训练好的转换后的torch模型,在val dataset 只有74.93%的miou

Model mIou
APCNet(torch) 79.08%
APCNet(paddle) 79.28%