{"id":13762419,"url":"https://github.com/Tramac/Lightweight-Segmentation","last_synced_at":"2025-05-10T15:31:22.154Z","repository":{"id":99648520,"uuid":"188342349","full_name":"Tramac/Lightweight-Segmentation","owner":"Tramac","description":"Lightweight models for real-time semantic segmentation(include mobilenetv1-v3, shufflenetv1-v2, igcv3, efficientnet).","archived":false,"fork":false,"pushed_at":"2020-09-08T08:44:33.000Z","size":60,"stargazers_count":355,"open_issues_count":11,"forks_count":77,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-16T21:32:56.838Z","etag":null,"topics":["lightweight","network-analysis","real-time","semantic-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tramac.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}},"created_at":"2019-05-24T02:56:13.000Z","updated_at":"2024-11-16T20:01:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5219924d-bb64-4b4a-be87-23da8f871632","html_url":"https://github.com/Tramac/Lightweight-Segmentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tramac%2FLightweight-Segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tramac%2FLightweight-Segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tramac%2FLightweight-Segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tramac%2FLightweight-Segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tramac","download_url":"https://codeload.github.com/Tramac/Lightweight-Segmentation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253436429,"owners_count":21908324,"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":["lightweight","network-analysis","real-time","semantic-segmentation"],"created_at":"2024-08-03T14:00:42.224Z","updated_at":"2025-05-10T15:31:21.892Z","avatar_url":"https://github.com/Tramac.png","language":"Python","readme":"# Lightweight Model for Real-Time Semantic Segmentation\n\n[![python-image]][python-url]\n[![pytorch-image]][pytorch-url]\n[![lic-image]][lic-url]\n\nThis project aims at providing the popular lightweight model implementations for real-time semantic segmentation.\n\n## Usage\n\n------\n\n### Train\n\n- **Single GPU training**\n\n```\npython train.py --model mobilenet --dataset citys --lr 0.01 --epochs 240\n```\n\n- **Multi-GPU training**\n\n```\n# for example, train mobilenet with 4 GPUs:\nexport NGPUS=4\npython -m torch.distributed.launch --nproc_per_node=$NGPUS train.py --model mobilenet --dataset citys --lr 0.01 --epochs 240\n```\n\n### Evaluation\n\n- **Single GPU evaluating**\n\n```\npython eval.py --model mobilenet_small --dataset citys\n```\n\n- **Multi-GPU evaluating**\n\n```\n# for example, evaluate mobilenet with 4 GPUs:\nexport NGPUS=4\npython -m torch.distributed.launch --nproc_per_node=$NGPUS eval.py --model mobilenet --dataset citys\n```\n\n## Result\n\n- **Cityscapes**\n\nWhere: `crop_size=768, lr=0.01, epochs=80`.\n\n|     Backbone      | OHEM | Params(M) | FLOPs(G) | CPU(fps) | GPU(fps) | mIoU/pixACC |                            Model                             |\n| :---------------: | :--: | :-------: | :------: | :------: | :------: | :---------: | :----------------------------------------------------------: |\n|     mobilenet     |  ✘   |   5.31    |   4.48   |   0.81   |  77.11   | 0.463/0.901 | [GoogleDrive](https://drive.google.com/file/d/1imOndYZDKccQED_RVVUa_I5mYClL1Wy1/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1De4ESrHCqdev0nQrKOUzaA)(ybsg) |\n|     mobilenet     |  ✓   |   5.31    |   4.48   |   0.81   |  75.35   | 0.526/0.909 | [GoogleDrive](https://drive.google.com/file/d/1uKswsffm5Zg_cYP2Xosm_JtSub74bEs3/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1R3k07vCiYbvz9FztEnAUsw)(u2y2) |\n|    mobilenetv2    |  ✓   |   4.88    |   4.04   |   0.49   |  49.40   | 0.613/0.930 | [GoogleDrive](https://drive.google.com/file/d/1JrphJXLr311S3CrvIPgXzedYzuZROydp/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1OWPsDvSjeOM2_VUbPze7gA)(q2g5) |\n| mobilenetv3_small |  ✓   |   1.02    |   1.64   |   2.59   |  104.56  | 0.529/0.908 | [GoogleDrive](https://drive.google.com/file/d/1CL9XJ2NtGOj2vLwIsG_X9jdkYa_8x-Bo/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/15PjAXEQHr136w-B1MalmIg)(e7no) |\n| mobilenetv3_large |  ✓   |   2.68    |   4.59   |   1.39   |  79.43   | 0.584/0.916 | [GoogleDrive](https://drive.google.com/file/d/10twlfVqixUqUwwfqGkI__NcrxKZIo1dg/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1ofXAfN4qDhtsI5kEI90biw)(i60c) |\n|    shufflenet     |  ✓   |   6.89    |   5.68   |   0.57   |  43.79   | 0.493/0.901 | [GoogleDrive](https://drive.google.com/file/d/1Bm3FAIIEqZm9mDRPj9H75zsGpxvEWe76/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1jI2oyoGrTO6JbPp0lL28tw)(6fjh) |\n|   shufflenetv2    |  ✓   |   5.24    |   4.33   |   0.72   |  57.71   | 0.528/0.914 | [GoogleDrive](https://drive.google.com/file/d/1glXDHrB0pPOKNc2UucbQm1Be-NOuvrUA/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1HZ97h15tz42eMJohyx-H2w)(7pi5) |\n|       igcv3       |  ✓   |   4.86    |   4.04   |   0.34   |  29.70   | 0.573/0.923 | [GoogleDrive](https://drive.google.com/file/d/1sahSoagKfAKYsu8KnueeIBU_xufS3RLx/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1neM8JiGD5an_WXMhrfnxtA)(qe4f) |\n|  efficientnet-b0  |  ✓   |   6.63    |   2.60   |   0.33   |  30.15   | 0.492/0.903 | [GoogleDrive](https://drive.google.com/file/d/1sLBOAzHwXnPqvPH6zKOhRoRT1TwktxVo/view?usp=sharing),[BaiduCloud](https://pan.baidu.com/s/1PVXkARVzoOPUHsznwQVZRw)(phuy) |\n\n- **Improve**\n\n|       Model       | batch_size | epochs | crop_size |   init_weight   | optimizer | mIoU/pixACC |\n| :---------------: | :--------: | :----: | :-------: | :-------------: | :-------: | :---------: |\n| mobilenetv3_small |     4      |   80   |    768    | kaiming_uniform |    SGD    | 0.529/0.908 |\n| mobilenetv3_small |     4      |  160   |    768    | kaiming_uniform |    SGD    | 0.587/0.918 |\n| mobilenetv3_small |     8      |  160   |    768    | kaiming_uniform |    SGD    | 0.553/0/913 |\n| mobilenetv3_small |     4      |   80   |   1024    | kaiming_uniform |    SGD    | 0.557/0.914 |\n| mobilenetv3_small |     4      |   80   |    768    | xavier_uniform  |    SGD    | 0.550/0.911 |\n| mobilenetv3_small |     4      |   80   |    768    | kaiming_uniform |   Adam    | 0.549/0.911 |\n| mobilenetv3_small |     8      |  160   |   1024    | xavier_uniform  |    SGD    | 0.612/0.920 |\n\n## Support\n\n- [MobileNet](https://arxiv.org/abs/1704.04861)\n- [MobileNetV2](https://arxiv.org/abs/1801.04381)\n- [MobileNetV3](https://arxiv.org/abs/1905.02244)\n- [ShuffleNet](https://arxiv.org/abs/1707.01083)\n- [ShuffleNetV2](https://arxiv.org/abs/1807.11164)\n- [IGCV3](https://arxiv.org/pdf/1806.00178)\n- [EfficientNet](https://arxiv.org/pdf/1905.11946v1)\n\n## To Do\n\n- [ ] improve performance\n- [ ] optimize memory\n- [ ] check efficientnet\n- [ ] replace `nn.SyncBatchNorm` by [`nn.BatchNorm.convert_sync_batchnorm`](https://pytorch.org/docs/master/nn.html#torch.nn.SyncBatchNorm)\n- [ ] check `find_unused_parameters` in `nn.parallel.DistributedDataParallel`\n\n## References\n\n- [maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark)\n- [mobilenetv3-segmentation](https://github.com/Tramac/mobilenetv3-segmentation)\n- [awesome-semantic-segmentation-pytorch](https://github.com/Tramac/awesome-semantic-segmentation-pytorch)\n\n\u003c!--\n[![python-image]][python-url]\n[![pytorch-image]][pytorch-url]\n[![lic-image]][lic-url]\n--\u003e\n\n[python-image]: https://img.shields.io/badge/Python-2.x|3.x-ff69b4.svg\n[python-url]: https://www.python.org/\n[pytorch-image]: https://img.shields.io/badge/PyTorch-1.1-2BAF2B.svg\n[pytorch-url]: https://pytorch.org/\n[lic-image]: https://img.shields.io/badge/Apache-2.0-blue.svg\n[lic-url]: https://github.com/Tramac/mobilenetv3-segmentation/blob/master/LICENSE\n","funding_links":[],"categories":["Toolbox","⚡ Real-time \u0026 Mobile Segmentation","Support"],"sub_categories":["Libraries","📚 Comprehensive Repositories","Demo"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTramac%2FLightweight-Segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTramac%2FLightweight-Segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTramac%2FLightweight-Segmentation/lists"}