{"id":19243160,"url":"https://github.com/acecoooool/segmentation","last_synced_at":"2026-04-16T11:03:58.106Z","repository":{"id":201607408,"uuid":"183710920","full_name":"AceCoooool/segmentation","owner":"AceCoooool","description":"Semantic Segmentation sub-project","archived":false,"fork":false,"pushed_at":"2019-05-15T11:21:25.000Z","size":178,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T15:52:24.481Z","etag":null,"topics":["pytorch","segmentation","semantic-segmentation","state-of-the-art"],"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/AceCoooool.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}},"created_at":"2019-04-27T00:42:49.000Z","updated_at":"2020-09-21T04:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a667bb17-606c-4604-9daa-b1ef2d5062c2","html_url":"https://github.com/AceCoooool/segmentation","commit_stats":null,"previous_names":["acecoooool/segmentation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AceCoooool/segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2Fsegmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2Fsegmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2Fsegmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2Fsegmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AceCoooool","download_url":"https://codeload.github.com/AceCoooool/segmentation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2Fsegmentation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["pytorch","segmentation","semantic-segmentation","state-of-the-art"],"created_at":"2024-11-09T17:16:51.363Z","updated_at":"2026-04-16T11:03:58.091Z","avatar_url":"https://github.com/AceCoooool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Segmentation\n\nThis is a sub-project of [pytorch-cv](https://github.com/AceCoooool/pytorch-cv)（for convenient）\n\n**Support Models：**\n\n- [x] FCN\n- [x] PSPNet\n- [x] DeepLabv3\n- [x] DANet\n- [x] OCNet\n\n## Environment\n\n- PyTorch 1.1\n\n## Performance\n\n#### Pascal VOC 2012\n\nHere, we using train (10582), val (1449), test (1456) as most paper used. (More detail can reference [DeepLabv3](https://github.com/chenxi116/DeepLabv3.pytorch)) . And the performance is evaluated with single scale\n\n- Base Size 540, Crop Size 480\n\n|   Model    |   backbone    |   Paper    | OHEM | aux  | dilated | JPU  | Epoch |                          val (crop)                          |     val     |\n| :--------: | :-----------: | :--------: | :--: | :--: | :-----: | :--: | :---: | :----------------------------------------------------------: | :---------: |\n|    FCN     | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✗    |  ✓   |  50   | [94.54/78.31](https://drive.google.com/open?id=1-FF5BUSB9hNCyldC1nV35LeWLSQFa9Jl) | 94.50/76.89 |\n|   PSPNet   | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✓    |  ✗   |  50   | [94.87/80.13](https://drive.google.com/open?id=1g40cVTJRCHLBKwVqjev4yQA5YflQwhrv) | 94.88/78.57 |\n|   PSPNet   | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✗    |  ✓   |  50   |                       [94.89/79.90](https://drive.google.com/open?id=1XRFiijt0tAbLgXhV5oVEot6qLccz9JyA)                        | 94.77/78.48 |\n| DeepLabv3  | ResNet101-v1s | no / 77.02 |  ✗   |  ✓   |    ✗    |  ✓   |  50   | [95.17/81.00](https://drive.google.com/open?id=1R0C6qwCxOLztps4odVWLiZpe57n5TuDX) | 94.81/78.75 |\n|   DANet    | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✗    |  ✓   |  50   | [94.98/80.49](https://drive.google.com/open?id=1jS69enf_dyn8l27DfMDuzt_ulva7KSWt) | 94.85/78.72 |\n| OCNet-Base | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✗    |  ✓   |  50   | [94.91/80.33](https://drive.google.com/open?id=15gs_gzgAT_hciPgwm12G_MRMi0VZg9Gb) | 94.86/79.07 |\n| OCNet-ASP  | ResNet101-v1s |     /      |  ✗   |  ✓   |    ✗    |  ✓   |  50   |                                                              |             |\n\n\u003e 1. the metric is `pixAcc/mIoU`\n\u003e 2. `aux_weight=0.5`\n\n#### Cityscapes\n\nHere, we only using fine train (2975), val (500) as most paper used. (More detail can reference [DeepLabv3](https://github.com/chenxi116/DeepLabv3.pytorch)) . And the performance is evaluated with single scale\n\n- Base Size 1024, Crop Size 768\n\n|   Model    |   backbone    | Paper(*) | OHEM | aux  | dilated | JPU  | Epoch | val (crop)  |                             val                              |\n| :--------: | :-----------: | :------: | :--: | :--: | :-----: | :--: | :---: | :---------: | :----------------------------------------------------------: |\n|    FCN     | ResNet101-v1s | no/75.96 |  ✗   |  ✓   |    ✗    |  ✓   |  120  | 96.29/73.60 | [96.18/78.61](https://drive.google.com/open?id=119bPxJwL6zAtEyvEJiHljK6US9f-d5Xr) |\n|   PSPNet   | ResNet101-v1s | no/78.56 |  ✗   |  ✓   |    ✗    |  ✓   |  120  | 96.21/73.64 | [96.09/78.62](https://drive.google.com/open?id=1qJVXevkErgVvsa4x8mCvAdMlCIuVMJ1C) |\n| DeepLabv3  | ResNet101-v1s | no/78.90 |  ✗   |  ✓   |    ✗    |  ✓   |  120  | 96.25/73.44 | [96.23/79.03](https://drive.google.com/open?id=1_XIIeIKEMbg4M2SO49Vq756d20zjeXxk) |\n|   DANet    | ResNet101-v1s | no/78.83 |      |      |         |      |       |             |                                                              |\n| OCNet-Base | ResNet101-v1s | no/79.67 |  ✗   |  ✓   |    ✗    |  ✓   |  120  | 96.30/74.18 | [TODO](https://drive.google.com/open?id=1q2h8d_mJeyHfmCRQellTSpralv8ubI5L) |\n| OCNet-ASP  | ResNet101-v1s |          |      |      |         |      |       |             |                                                              |\n\n\u003e Note：\n\u003e\n\u003e 1. Paper(*) means results from: [openseg.pytorch](https://github.com/openseg-group/openseg.pytorch)（results with single scale without crop），there are a little different in the training strategy.  \n\n## Demo\n\nDemo of segmentation of a given image.  (Please download pre-trained model to `~/.torch/models` first. --- If you put pre-trained model to other folder, please change the `--root`)\n\n```shell\n$ python demo_segmentation_pil.py [--model fcn_resnet101_voc] [--input-pic \u003cimage\u003e.jpg] [--cuda true] [--aux true] [--jpu true] [--dilated false]\n```\n\n\u003e Note：\n\u003e\n\u003e 1. if not give `--input-pic`, using default image we provided. \n\u003e 2. `aux, jpu, dilated` is depend on your model\n\n## Evaluation\n\nThe default data root is `~/.torch/datasets` (You can download dataset and build a soft-link to it)\n\n```shell\n$ python eval_segmentation_pil.py [--model_name fcn_resnet101_voc] [--dataset pascal_paper] [--split val] [--mode testval|val] [--base-size 540] [--crop-size 480] [--aux true] [--jpu true] [--dilated false] [--cuda true]\n```\n\n\u003e Note：\n\u003e\n\u003e 1. if you choose `mode=testval`，you can not set `base-size` and `crop-size`\n\u003e 2. `aux, jpu, dilated` is depend on your model \n\n## Train\n\nDownload pre-trained backbone and put it on `~/.torch/models`\n\nRecommend to using distributed training.\n\n```shell\n$ export NGPUS=4\n$ python -m torch.distributed.launch --nproc_per_node=$NGPUS train_segmentation_pil.py [--model fcn] [--backbone resnet101] [--dataset pascal_voc] [--batch-size 8] [--base-size 540] [--crop-size 480] [--aux true] [--jpu true] [--dilated false] [--log-step 10]\n```\n\n\u003e Our training results' setting can see [train.sh](scripts/train.sh)\n\n## Prepare data\n\n#### VOC2012\n\n```shell\nmkdir data\ncd data\nwget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar\ntar -xf VOCtrainval_11-May-2012.tar\ncd VOCdevkit/VOC2012/\nwget http://cs.jhu.edu/~cxliu/data/SegmentationClassAug.zip\nwget http://cs.jhu.edu/~cxliu/data/SegmentationClassAug_Visualization.zip\nwget http://cs.jhu.edu/~cxliu/data/list.zip\nunzip SegmentationClassAug.zip\nunzip SegmentationClassAug_Visualization.zip\nunzip list.zip\n```\n\nYour can make a soft link to `.torch/datasets/voc`\n\n#### Cityscapes\n\n```shell\nunzip leftImg8bit_trainvaltest.zip\nunzip gtFine_trainvaltest.zip\ngit clone https://github.com/mcordts/cityscapesScripts.git\nmv cityscapesScripts/cityscapesscripts ./\n```\n\nYour can make a soft link to `.torch/datasets/citys`\n\n## Download\n\n#### Backbone\n\n| resnet50-v1s                                                 | resnet101-v1s                                                |\n| ------------------------------------------------------------ | ------------------------------------------------------------ |\n| [GoogleDrive](https://drive.google.com/open?id=1Mx_SIv1o1qjRz1tqEc-ggQ_MtZKQT3ET) | [GoogleDrive](https://drive.google.com/open?id=1pA_tN2MFi-7J5n1og10kDnV8raphM3V-) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Fsegmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facecoooool%2Fsegmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Fsegmentation/lists"}