MIT License

项目介绍

rishizek/tensorflow-deeplab-v3 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 288 个 Star、96 次 Fork。

仓库全名
rishizek/tensorflow-deeplab-v3
开源许可证
MIT License
Star 数
288
Fork 数
96
未关闭 Issue
35

README 摘要

DeepLab-v3 Semantic Segmentation in TensorFlow This repo attempts to reproduce DeepLabv3 in TensorFlow for semantic image segmentation on the PASCAL VOC dataset. The implementation is largely based on DrSleep's DeepLab v2 implemantation and tensorflow models Resnet implementation. Setup Please install latest version of TensorFlow (r1.6) and use Python 3. Download and extract PASCAL VOC training/validation data (2GB…

完整内容见 GitHub 原始 README 或本页 。

常见问题

tensorflow-deeplab-v3 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 288 个 Star。

tensorflow-deeplab-v3 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 tensorflow-deeplab-v3 的源码?

可以直接克隆仓库:git clone https://github.com/rishizek/tensorflow-deeplab-v3.git,默认分支为 master;安装与运行步骤见仓库 README。

tensorflow-deeplab-v3 最近还在维护吗?

仓库最近一次更新为 2018年9月30日,当前有 35 个未关闭 Issue;Star 数为 288,可作为社区活跃度的参考。

关于

DeepLabv3 built in TensorFlow

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
496
价值分
201
活跃状态
活跃

README

DeepLab-v3 Semantic Segmentation in TensorFlow

This repo attempts to reproduce DeepLabv3 in TensorFlow for semantic image segmentation on the PASCAL VOC dataset. The implementation is largely based on DrSleep’s DeepLab v2 implemantation and tensorflow models Resnet implementation.

Setup

Please install latest version of TensorFlow (r1.6) and use Python 3.

  • Download and extract PASCAL VOC training/validation data (2GB tar file), specifying the location with the --data_dir.
  • Download and extract augmented segmentation data (Thanks to DrSleep), specifying the location with --data_dir and --label_data_dir (namely, $data_dir/$label_data_dir).
  • For inference the trained model with 76.42% mIoU on the Pascal VOC 2012 validation dataset is available here. Download and extract to --model_dir.
  • For training, you need to download and extract pre-trained Resnet v2 101 model from slim specifying the location with --pre_trained_model.

Training

For training model, you first need to convert original data to the TensorFlow TFRecord format. This enables to accelerate training seep.

python create_pascal_tf_record.py --data_dir DATA_DIR \
                                  --image_data_dir IMAGE_DATA_DIR \
                                  --label_data_dir LABEL_DATA_DIR 

Once you created TFrecord for PASCAL VOC training and validation deta, you can start training model as follow:

python train.py --model_dir MODEL_DIR --pre_trained_model PRE_TRAINED_MODEL

Here, --pre_trained_model contains the pre-trained Resnet model, whereas --model_dir contains the trained DeepLabv3 checkpoints. If --model_dir contains the valid checkpoints, the model is trained from the specified checkpoint in --model_dir.

You can see other options with the following command:

python train.py --help

The training process can be visualized with Tensor Board as follow:

tensorboard --logdir MODEL_DIR

Evaluation

To evaluate how model perform, one can use the following command:

python evaluate.py --help

The current best model build by this implementation achieves 76.42% mIoU on the Pascal VOC 2012 validation dataset.

Method OS mIOU
paper MG(1,2,4)+ASPP(6,12,18)+Image Pooling 16 77.21%
repo MG(1,2,4)+ASPP(6,12,18)+Image Pooling 16 76.42%

Here, the above model was trained about 9.5 hours (with Tesla V100 and r1.6) with following parameters:

python train.py --train_epochs 46 --batch_size 16 --weight_decay 1e-4 --model_dir models/ba=16,wd=1e-4,max_iter=30k --max_iter 30000

You may achieve better performance with the cost of computation with my DeepLabV3+ Implementation.

Inference

To apply semantic segmentation to your images, one can use the following commands:

python inference.py --data_dir DATA_DIR --infer_data_list INFER_DATA_LIST --model_dir MODEL_DIR 

The trained model is available here. One can find the detailed explanation of mask such as meaning of color in DrSleep’s repo.

TODO:

Pull requests are welcome.

  • Freeze batch normalization during training
  • Multi-GPU support
  • Channels first support (Apparently large performance boost on GPU)
  • Model pretrained on MS-COCO
  • Unit test

Acknowledgment

This repo borrows code heavily from

评论

暂无评论