Liu Yi c8d91034ae | 2 years ago | |
---|---|---|
.. | ||
configs | 3 years ago | |
core | 3 years ago | |
datasets | 3 years ago | |
docs | 3 years ago | |
models | 3 years ago | |
transforms | 3 years ago | |
utils | 3 years ago | |
README.md | 2 years ago | |
predict.py | 3 years ago | |
train.py | 3 years ago | |
val.py | 3 years ago |
基于PaddlePaddle实现Panoptic Deeplab全景分割算法。
Panoptic DeepLab首次证实了bottem-up算法能够达到state-of-the-art的效果。Panoptic DeepLab预测三个输出:Semantic Segmentation, Center Prediction 和 Center Regression。实例类别像素根据最近距离原则聚集到实例中心点得到实例分割结果。最后按照majority-vote规则融合语义分割结果和实例分割结果,得到最终的全景分割结果。
其通过将每一个像素赋值给每一个类别或实例达到分割的效果。
Backbone | Batch Size | Resolution | Training Iters | PQ | SQ | RQ | AP | mIoU | Links |
---|---|---|---|---|---|---|---|---|---|
ResNet50_OS32 | 8 | 2049x1025 | 90000 | 58.35% | 80.03% | 71.52% | 25.80% | 79.18% | model | log |
ResNet50_OS32 | 64 | 1025x513 | 90000 | 60.32% | 80.56% | 73.56% | 26.77% | 79.67% | model | log |
git clone https://github.com/PaddlePaddle/PaddleSeg
cd PaddleSeg
pip install -e .
cd contrib/PanopticDeepLab
将数据集放置于PaddleSeg/contrib/PanopticDeepLab目录下的data
目录下。
前往CityScapes官网下载数据集并整理成如下结构:
cityscapes/
|--gtFine/
| |--train/
| | |--aachen/
| | | |--*_color.png, *_instanceIds.png, *_labelIds.png, *_polygons.json,
| | | |--*_labelTrainIds.png
| | | |--...
| |--val/
| |--test/
| |--cityscapes_panoptic_train_trainId.json
| |--cityscapes_panoptic_train_trainId/
| | |-- *_panoptic.png
| |--cityscapes_panoptic_val_trainId.json
| |--cityscapes_panoptic_val_trainId/
| | |-- *_panoptic.png
|--leftImg8bit/
| |--train/
| |--val/
| |--test/
安装CityscapesScripts
pip install git+https://github.com/mcordts/cityscapesScripts.git
*_panoptic.png
生成命令(需找到createPanopticImgs.py
文件):
python /path/to/cityscapesscripts/preparation/createPanopticImgs.py \
--dataset-folder data/cityscapes/gtFine/ \
--output-folder data/cityscapes/gtFine/ \
--use-train-id
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 # 根据实际情况进行显卡数量的设置
python -m paddle.distributed.launch train.py \
--config configs/panoptic_deeplab/panoptic_deeplab_resnet50_os32_cityscapes_1025x513_bs8_90k_lr00005.yml \
--do_eval \
--use_vdl \
--save_interval 5000 \
--save_dir output
note: 使用--do_eval会影响训练速度及增加显存消耗,根据选择进行开闭。
更多参数信息请运行如下命令进行查看:
python train.py --help
python val.py \
--config configs/panoptic_deeplab/panoptic_deeplab_resnet50_os32_cityscapes_1025x513_bs8_90k_lr00005.yml \
--model_path output/iter_90000/model.pdparams
你可以直接下载我们提供的模型进行评估。
更多参数信息请运行如下命令进行查看:
python val.py --help
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 # 根据实际情况进行显卡数量的设置
python -m paddle.distributed.launch predict.py \
--config configs/panoptic_deeplab/panoptic_deeplab_resnet50_os32_cityscapes_1025x513_bs8_90k_lr00005.yml \
--model_path output/iter_90000/model.pdparams \
--image_path data/cityscapes/leftImg8bit/val/ \
--save_dir ./output/result
你可以直接下载我们提供的模型进行预测。
更多参数信息请运行如下命令进行查看:
python predict.py --help
全景分割结果:
语义分割结果:
实例分割结果:
飞桨高性能图像分割开发套件,端到端完成从训练到部署的全流程图像分割应用。
https://github.com/PaddlePaddle/PaddleSeg
Python Markdown Text Shell Java other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》