开源软件名称(OpenSource Name):nolanliou/mobile-deeplab-v3-plus
开源软件地址(OpenSource Url):https://github.com/nolanliou/mobile-deeplab-v3-plus
开源编程语言(OpenSource Language):
Python
94.1%
开源软件介绍(OpenSource Introduction):Mobile Deeplab-V3+ model for Segmentation
This project is used for deploying people segmentation model to mobile device
and learning. The people segmentation android project is here. The model is another Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation (Deeplab-V3+) implementation base on
MobilenetV2 / MobilenetV3 on TensorFlow.
This project uses tf.estimator API to do training, and many code come from TensorFlow model,
Dataset
This project supports 2 dataset.
- PASCAL VOC2012
- Supervisely People dataset.
Environment
- TensorFlow v1.12.0
- No module named keras_applications: solution
- AttributeError: 'Estimator' object has no attribute '_distribution':
solution.
Usage
- Prepare pretrained MobilenetV2 model(optional)
- Train
- train on pascal voc 2012 dataset
bash train_pascal_voc2012.sh
# Tensorboard
tensorboard --logdir=datasets/pascal_voc2012/exp/deeplab-v3-plus/train
- train on people segmentation dataset
mv people_segmentation.tar.gz datasets
bash train_people_seg.sh
# Tensorboard
tensorboard --logdir=datasets/people_segmentation/exp/deeplab-v3-plus/train
- Export and Freeze model
bash export_pascal_voc2012.sh
# Output
# 1. TensorFlow Serving: datasets/pascal_voc2012/exp/deeplab-v3-plus/export/
# 2. Frozen model: datasets/pascal_voc2012/exp/deeplab-v3-plus/export/frozen_model.pb
- people segmentation dataset
bash export_people_seg.sh
# Output
# 1. TensorFlow Serving: datasets/people_segmentation/exp/deeplab-v3-plus/export/
# 2. Frozen model: datasets/people_segmentation/exp/deeplab-v3-plus/export/frozen_model.pb
Explanation
You could modify the parameters and add new backbones network easily.
- Use
MobilenetV3 backbone: Change parameter from --backbone="MobielentV2" to --backbone="MobilenetV3"
quant_friendly : Remove BN layer after Depthwise Convolution , replace relu6 with relu ,
method from A Quantization-Friendly Separable Convolution for MobileNets.
Result
- Pascal VOC2012
Backbone |
Pretrained backbone |
Augmented |
Input Size |
ASPP |
Decoder |
mIOU(%) |
MobilenetV2 |
YES |
YES |
513x513 |
NO |
NO |
70.51 |
- Environment: base_lr=0.007, training_steps=30000, learning_policy=poly, num_gpu=1.
- People Segmentation Dataset
Backbone |
Input Size |
Augmented |
ASPP |
Decoder |
Quant-Friendly |
Steps |
mIOU(%) |
Pretrained Model |
MobilenetV2 |
256x256 |
YES |
NO |
YES |
YES |
150000 |
81.68 |
model |
MobilenetV2 |
256x256 |
YES |
YES |
YES |
YES |
150000 |
83.33 |
model |
MobilenetV3 |
256x256 |
YES |
No |
YES |
YES |
150000 |
81.86 |
model |
MobilenetV2 |
513x513 |
YES |
No |
YES |
YES |
150000 |
89.55 |
model |
- Environment: base_lr=0.05, training_steps=150000, learning_policy=poly, num_gpu=1.
Augmented : use augmented dataset.
TODO
References
- https://github.com/tensorflow/models/tree/master/research/deeplab
- https://github.com/rishizek/tensorflow-deeplab-v3-plus
- https://github.com/kuan-wang/pytorch-mobilenet-v3/blob/master/mobilenetv3.py
- https://github.com/DrSleep/tensorflow-deeplab-resnet
|
请发表评论