python交通标志识别_DataFountain-基于虚拟仿真环境下的自动驾驶交通标志识别 4th...

原作者是Yifu Chen,该仓库版权属于Yifu Chen。

打个广告:算力充足的大佬可以跑跑mmdetection的SENet-154的backbone,给大伙贡献个coco预训练模型,功在当代,利在千秋啊!地址请戳mmdetection_with_SENet154。

datafountain sign detection

分割->抠图->检测

比赛定位精度要求太高,关键还是使用cascade+更好的backbone,前几大佬基本都用了4个cascade头+cvpr19-HRNet,另外加上GIoU-loss和KL-loss应该有可观提升。

requirements

python>=3.6

numpy

pandas

opencv-python

pytorch >= 1.0.0

matplotlib

pycocotools

tqdm

cython

cffi

opencv-python >= 4.0

scipy

msgpack

easydict

matplotlib

pyyaml

tensorboardX

数据准备

数据目录为~/data/dfsign,下载zip文件和label文件,解压zip到test和train目录

~/data

├── dfsign

│ ├── test

│ ├── train

│ ├── Test_fix.zip

│ ├── Train_fix.zip

│ ├── train_label_fix.csv

代码准备

代码需要放在特定目录$WORKDIR = ~/working/dfsign

链接数据

ln -s ~/data $WORKDIR/mmdetection

mmdetection extensions

cd $WORKDIR/mmdetection

./compile.sh

python setup.py develop

模型权重准备

将deeplab模型放在$WORKDIR/pytorch-deeplab-xception/run/dfsign

将detection模型放在WORKDIR/mmdetection/dfsign/work_dirs

生成训练数据

cd $WORKDIR/tools

# generate segmentation dataset

python convert2voc.py train_test

# generate detection trainset

python generate_train_chip.py

训练

使用deeplab和mmdetection中cascade

测试

cd $WORKDIR/pytorch-deeplab-xception

# run deeplab

./test.sh

cd $WORKDIR/tools

# crop seg results

python generate_mask_chip.py

cd $WORKDIR/mmdetection/dfsign

# run detect model_1 on images from seg results

python detect.py cascade_rcnn_x101_64x4d_fpn.py work_dirs/cascade_rcnn_x101_64x4d_fpn_1x/9954.pth --chip

cd $WORKDIR/tools

# crop detect results

python generate_detect_chip.py

cd $WORKDIR/mmdetection/dfsign

# run detect model_1 on images from detect results

python detect.py cascade_rcnn_x101_64x4d_fpn.py work_dirs/cascade_rcnn_x101_64x4d_fpn_1x/9954.pth

cd $WORKDIR/tools

# predict_1

python dfsign_submit.py predict_1

cd $WORKDIR/mmdetection/dfsign

# 修改cascade_rcnn_x101_64x4d_fpn_1x.py中25行anchor_ratios为[0.5, 1.0, 2.0]

# run detect model_2 on images from detect results

python detect.py cascade_rcnn_x101_64x4d_fpn.py work_dirs/cascade_rcnn_x101_64x4d_fpn_1x/9946.pth

cd $WORKDIR/tools

# predict_2

python dfsign_submit.py predict_2

# ensemble

python dfsign_ensemble

# 生成的predict.csv为最终结果

你可能感兴趣的:(python交通标志识别)