{"id":13701638,"url":"https://github.com/IbrahimSobh/Segmentation","last_synced_at":"2025-05-04T21:31:16.371Z","repository":{"id":177418334,"uuid":"471769782","full_name":"IbrahimSobh/Segmentation","owner":"IbrahimSobh","description":"In this tutorial, you will perform inference across 10 well-known pre-trained semantic segmentors and fine-tune on a custom dataset. Design and train your own segmentor.","archived":false,"fork":false,"pushed_at":"2022-04-24T00:14:21.000Z","size":6160,"stargazers_count":74,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-13T07:36:21.150Z","etag":null,"topics":["computer-vision","deep-learning","semantic-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/IbrahimSobh.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":"2022-03-19T17:44:06.000Z","updated_at":"2024-11-02T08:23:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"fee4433a-8e22-49e1-b9e8-ede17df850db","html_url":"https://github.com/IbrahimSobh/Segmentation","commit_stats":null,"previous_names":["ibrahimsobh/segmentation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbrahimSobh%2FSegmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbrahimSobh%2FSegmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbrahimSobh%2FSegmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbrahimSobh%2FSegmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IbrahimSobh","download_url":"https://codeload.github.com/IbrahimSobh/Segmentation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252403960,"owners_count":21742470,"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":["computer-vision","deep-learning","semantic-segmentation"],"created_at":"2024-08-02T20:01:53.114Z","updated_at":"2025-05-04T21:31:11.355Z","avatar_url":"https://github.com/IbrahimSobh.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"#  Semantic segmentation\n\n![seg_cov](images/segcover.png)\n\nSemantic image segmentation is the task of classifying each pixel in an image from a predefined set of classes.\n\nIn this tutorial, you will:\n- Perform inference with 10 well-known semantic segmentors \u003ca href=\"https://colab.research.google.com/drive/1WJtghM5munkksP2CZQ90fiVTYkSL3e3S?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n- Fine tune semantic segmentors on a custom dataset \u003ca href=\"https://colab.research.google.com/drive/1e6QgCHvfcm54pSSv0Cf4GiUlpNPXoMxv?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n- Design and train your own semantic segmentation model \u003ca href=\"https://colab.research.google.com/drive/1EX9uUhikpWkgO-E0Eews0mJaDPbQp6yl?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\n\n\n\nThis work is based on [MMSegmentation](https://github.com/open-mmlab/mmsegmentation): [OpenMMLab](https://github.com/open-mmlab) segmentation toolbox and benchmark.\n\n\n## 10 Semantic segmentors\n\n| Segmentor     | Paper         |\n| ------------- |:-------------:|\n| [FCN](https://arxiv.org/abs/1411.4038)    | Fully Convolutional Networks for Semantic Segmentation (2017)\n| [U-net](https://arxiv.org/abs/1505.04597)    | Convolutional networks for biomedical image segmentation (2015)\n| [PSPNet](https://arxiv.org/abs/1612.01105)    | Pyramid Scene Parsing Network (2017)\n| [DeepLabV3](https://arxiv.org/abs/1706.05587)    | Rethinking atrous convolution for semantic image segmentation (2017)\n| [UPerNet](https://arxiv.org/pdf/1807.10221.pdf)    | Unified Perceptual Parsing for Scene Understanding (2018)\n| [CCNet](https://arxiv.org/abs/1811.11721)    | Criss-Cross Attention for Semantic Segmentation (2019)\n| [FastFCN](https://arxiv.org/abs/1903.11816)    | Rethinking Dilated Convolution in the Backbone for Semantic Segmentation (2019)\n| [SETR](https://arxiv.org/abs/2012.15840)    | Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers (2020)\n| [Segmenter](https://arxiv.org/abs/2105.05633)    | Transformer for Semantic Segmentation (2021)\n| [SegFormer](https://arxiv.org/abs/2105.15203)    | Simple and Efficient Design for Semantic Segmentation with Transformers (2021)\n\n![res_yolof](https://github.com/open-mmlab/mmsegmentation/raw/master/resources/seg_demo.gif)\n\n-----\n\n## Perform inference \n\n\u003ca href=\"https://colab.research.google.com/drive/1WJtghM5munkksP2CZQ90fiVTYkSL3e3S?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\nHere is how to load a pretrained model, perfrom inference and vizualize the results.\n\n```\nmodel = init_segmentor(config, checkpoint, device='cuda:0')\nresult = inference_segmentor(model, img)\nmodel.show_result(img, result, out_file='result.jpg', win_name=m_name)\n```\n\n### Results\n\n| Segmentor     | Result         |\n| ------------- |:-------------:|\n| [FCN](https://arxiv.org/abs/1411.4038)    | ![res_yolof](images/fcn.png)\n| [U-net](https://arxiv.org/abs/1505.04597)    | ![res_yolof](images/unet.png)\n| [PSPNet](https://arxiv.org/abs/1612.01105)    | ![res_yolof](images/pspnet.png)\n| [DeepLabV3](https://arxiv.org/abs/1706.05587)    | ![res_yolof](images/deeplab.png)\n| [UPerNet](https://arxiv.org/pdf/1807.10221.pdf)    | ![res_yolof](images/upernet.png)\n| [CCNet](https://arxiv.org/abs/1811.11721)    | ![res_yolof](images/ccnet.png)\n| [FastFCN](https://arxiv.org/abs/1903.11816)    | ![res_yolof](images/fastfcn.png)\n| [SETR](https://arxiv.org/abs/2012.15840)    | ![res_yolof](images/setr.png)\n| [Segmenter](https://arxiv.org/abs/2105.05633)    | ![res_yolof](images/segmenter.png)\n| [SegFormer](https://arxiv.org/abs/2105.15203)    | ![res_yolof](images/segformer.png)\n\n\n\n-----\n\n## Fine tune semantic segmentors on a custom dataset\n\n\u003ca href=\"https://colab.research.google.com/drive/1e6QgCHvfcm54pSSv0Cf4GiUlpNPXoMxv?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\n- Select a semantic segmentation model: **SEgmentation TRansformer** [SETR](https://arxiv.org/abs/2012.15840)\n- Add a new dataset class: [Scene Understanding Datasets](http://dags.stanford.edu/projects/scenedataset.html)\n- Create a config file.\n- Conduct training and evaluation.\n\n![setr_arch](images/setr_arch.png)\n\n\n-----\n\n## Design and train your own semantic segmentor\n\n\u003ca href=\"https://colab.research.google.com/drive/1EX9uUhikpWkgO-E0Eews0mJaDPbQp6yl?usp=sharing\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\n- Select a semantic segmentation model: [UPerNet](https://arxiv.org/pdf/1807.10221.pdf) Unified Perceptual Parsing for Scene Understanding\n- Replabe the ResNet backbone with a new one: [ConvNeXt](https://arxiv.org/pdf/2201.03545.pdf) A ConvNet for the 2020s\n- Config the heads.\n- Add a new dataset class: [Scene Understanding Datasets](http://dags.stanford.edu/projects/scenedataset.html)\n- Conduct training and evaluation.\n\n![convnext](images/convnext.png)\n\nRegards! \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIbrahimSobh%2FSegmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIbrahimSobh%2FSegmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIbrahimSobh%2FSegmentation/lists"}