{"id":13857082,"url":"https://github.com/rishizek/tensorflow-deeplab-v3","last_synced_at":"2025-07-13T20:30:32.274Z","repository":{"id":93757843,"uuid":"119239967","full_name":"rishizek/tensorflow-deeplab-v3","owner":"rishizek","description":"DeepLabv3 built in TensorFlow","archived":false,"fork":false,"pushed_at":"2018-09-30T01:01:45.000Z","size":401,"stargazers_count":286,"open_issues_count":35,"forks_count":102,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-22T14:39:20.015Z","etag":null,"topics":["deeplab","deeplab-resnet","deeplabv3","pascal-voc","semantic-segmentation","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishizek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-01-28T08:10:54.000Z","updated_at":"2024-08-06T15:58:13.000Z","dependencies_parsed_at":"2023-05-04T18:48:38.797Z","dependency_job_id":null,"html_url":"https://github.com/rishizek/tensorflow-deeplab-v3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rishizek/tensorflow-deeplab-v3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishizek%2Ftensorflow-deeplab-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishizek%2Ftensorflow-deeplab-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishizek%2Ftensorflow-deeplab-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishizek%2Ftensorflow-deeplab-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishizek","download_url":"https://codeload.github.com/rishizek/tensorflow-deeplab-v3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishizek%2Ftensorflow-deeplab-v3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265199604,"owners_count":23726683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deeplab","deeplab-resnet","deeplabv3","pascal-voc","semantic-segmentation","tensorflow"],"created_at":"2024-08-05T03:01:25.264Z","updated_at":"2025-07-13T20:30:31.941Z","avatar_url":"https://github.com/rishizek.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# DeepLab-v3 Semantic Segmentation in TensorFlow\n\nThis repo attempts to reproduce [DeepLabv3](https://arxiv.org/abs/1706.05587) in \nTensorFlow for semantic image segmentation on the\n [PASCAL VOC dataset](http://host.robots.ox.ac.uk/pascal/VOC/).\n The implementation is largely based on\n [DrSleep's DeepLab v2 implemantation](https://github.com/DrSleep/tensorflow-deeplab-resnet) \n and \n [tensorflow models Resnet implementation](https://github.com/tensorflow/models/tree/master/official/resnet).\n \n\n## Setup\nPlease install latest version of TensorFlow (r1.6) and use Python 3.  \n- Download and extract \n[PASCAL VOC training/validation data](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar) \n(2GB tar file), specifying the location with the `--data_dir`.  \n- Download and extract \n[augmented segmentation data](https://www.dropbox.com/s/oeu149j8qtbs1x0/SegmentationClassAug.zip?dl=0) \n(Thanks to DrSleep), specifying the location with `--data_dir` and `--label_data_dir`\n(namely, `$data_dir/$label_data_dir`).  \n- For inference the trained model with `76.42%` mIoU on the Pascal VOC 2012 validation dataset\n is available \n[here](https://www.dropbox.com/s/gzwb0d6ydpfoxoa/deeplabv3_ver1.tar.gz?dl=0). Download and extract to \n`--model_dir`.\n- For training, you need to download and extract \n[pre-trained Resnet v2 101 model](http://download.tensorflow.org/models/resnet_v2_101_2017_04_14.tar.gz)\nfrom [slim](https://github.com/tensorflow/models/tree/master/research/slim)\nspecifying the location with `--pre_trained_model`.\n\n## Training\nFor training model, you first need to convert original data to\nthe TensorFlow TFRecord format. This enables to accelerate training seep. \n```bash\npython create_pascal_tf_record.py --data_dir DATA_DIR \\\n                                  --image_data_dir IMAGE_DATA_DIR \\\n                                  --label_data_dir LABEL_DATA_DIR \n```\nOnce you created TFrecord for PASCAL VOC training and validation deta, \nyou can start training model as follow:\n```bash\npython train.py --model_dir MODEL_DIR --pre_trained_model PRE_TRAINED_MODEL\n```\nHere, `--pre_trained_model` contains the pre-trained Resnet model, whereas \n`--model_dir` contains the trained DeepLabv3 checkpoints. \nIf `--model_dir` contains the valid checkpoints, the model is trained from the \nspecified checkpoint in `--model_dir`.\n\nYou can see other options with the following command:\n```bash\npython train.py --help\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/tensorboard_miou.png\" width=892 height=584\u003e\n\u003c/p\u003e\n\nThe training process can be visualized with Tensor Board as follow:\n```bash\ntensorboard --logdir MODEL_DIR\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/tensorboard_images.png\" width=892 height=318\u003e\n\n\u003c/p\u003e\n\n## Evaluation\nTo evaluate how model perform, one can use the following command:\n```bash\npython evaluate.py --help\n```\nThe current best model build by this implementation achieves `76.42%` mIoU on the Pascal VOC 2012 \nvalidation dataset. \n\n|       |Method                                | OS  | mIOU       |\n|:-----:|:------------------------------------:|:---:|:----------:|\n| paper | MG(1,2,4)+ASPP(6,12,18)+Image Pooling|16   | 77.21%     | \n| repo  | MG(1,2,4)+ASPP(6,12,18)+Image Pooling|16   | **76.42%** |\n\nHere, the above model was trained about 9.5 hours (with Tesla V100 and r1.6) with following parameters:\n```bash\npython 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\n```\nYou may achieve better performance with the cost of computation with my \n[DeepLabV3+ Implementation](https://github.com/rishizek/tensorflow-deeplab-v3-plus).\n\n## Inference\nTo apply semantic segmentation to your images, one can use the following commands:\n```bash\npython inference.py --data_dir DATA_DIR --infer_data_list INFER_DATA_LIST --model_dir MODEL_DIR \n```\nThe trained model is available [here](https://www.dropbox.com/s/gzwb0d6ydpfoxoa/deeplabv3_ver1.tar.gz?dl=0).\nOne can find the detailed explanation of mask such as meaning of color in \n[DrSleep's repo](https://github.com/DrSleep/tensorflow-deeplab-resnet).\n\n## TODO:\nPull requests are welcome.\n- [x] Freeze batch normalization during training\n- [ ] Multi-GPU support\n- [ ] Channels first support (Apparently large performance boost on GPU)\n- [ ] Model pretrained on MS-COCO\n- [ ] Unit test\n\n## Acknowledgment\nThis repo borrows code heavily from \n- [DrSleep's DeepLab-ResNet (DeepLabv2)](https://github.com/DrSleep/tensorflow-deeplab-resnet)\n- [TensorFlow Official Models](https://github.com/tensorflow/models/tree/master/official)\n- [Tensorflow Object Detection API](https://github.com/tensorflow/models/tree/master/research/object_detection)\n- [TensorFlow-Slim](https://github.com/tensorflow/models/tree/master/research/slim) \n- [TensorFlow](https://github.com/tensorflow/tensorflow)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishizek%2Ftensorflow-deeplab-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishizek%2Ftensorflow-deeplab-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishizek%2Ftensorflow-deeplab-v3/lists"}