← Open Source
Deeachain

Segmentation-Pytorch

Semantic Segmentation in Pytorch. Network include: FCN、FCN_ResNet、SegNet、UNet、BiSeNet、BiSeNetV2、PSPNet、DeepLabv3_plus、 HRNet、DDRNet.

Model DevelopmentDataset engineeringArchitecturePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
520
Stars
75
Forks
+0
This week
1
Contributors
Created 2020-04-19 · Updated 2026-09-24 · #17844 today
Top developers

Deeachain/Segmentation-Pytorch is ranked 17,844 with 520 stars.

Same-category comparison

Deeachain/Segmentation-Pytorch is ranked 17,844 among these 8 peers; OpenDriveLab/WorldEngine is ranked 17,846.

Same-category comparison
NameRankMetrics
bhanML/Co-teaching17,833
Language:
Python
Stars:
521
Forks:
109
Description:
NeurIPS'18: Co-teaching: Robust Training of Deep Neural Networks with Extremely Noisy Labels.
google-deepmind/narrativeqa17,837
Language:
Shell
Stars:
521
Forks:
70
Description:
This repository contains the NarrativeQA dataset. It includes the list of documents with Wikipedia summaries, links to full stories, and questions and answers.
kLabUM/rrcf17,838
Language:
Python
Stars:
521
Forks:
118
Description:
🌲 Implementation of the Robust Random Cut Forest algorithm for anomaly detection on streams.
lucasjinreal/keras_frcnn17,840
Language:
Python
Stars:
521
Forks:
272
Description:
Keras Implementation of faster-rcnn.
OpenDriveLab/WorldEngine17,846
Language:
Python
Stars:
520
Forks:
34
Description:
WorldEngine: Towards the Era of Post-Training for Autonomous Driving.
TellinaTool/nl2bash17,847
Language:
NewLisp
Stars:
520
Forks:
69
Description:
Generating bash command from natural language https://arxiv.org/abs/1802.08979.
XingangPan/deep-generative-prior17,848
Language:
Python
Stars:
520
Forks:
69
Description:
Code for deep generative prior (ECCV2020 oral).
maszhongming/MatchSum17,858
Language:
Python
Stars:
520
Forks:
105
Description:
Code for ACL 2020 paper: "Extractive Summarization as Text Matching".
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryDataset engineering, Architecture
KeywordsComputer vision, Distributed training, Model architecture, Visual understanding
Stars520
Forks75
Contributors1
Created date2020-04-19
Updated date2026-09-24
Stars in 1 day0
Stars in 7 days0
Rank17,844
Previous rank17,627
Rank change-217
7-day stars rank16,327
Previous 7-day stars rank16,335
7-day stars rank change8
Total stars rank18,772
Previous total stars rank18,748
Total stars rank change-24
CountryChina
README summary

10 Project structure adjustment, the previous code has been deleted, the adjustment will be re-uploaded code 2021. 09 Re-upload the code, "V1 Commit" 2021. 22 update torch distributed training Ongoing update . Display (Cityscapes) Using model DDRNet 1525 test sets, official MIOU =78. 4069% Comparison of the original and predicted images 2. Install Experimental environment: Ubuntu 16. 5 See Dependency Installation Package for details in requirement. 54% | - | √ | PSPNet | | DeeplabV3+ | ResNet 50 | 77. 78% | - | √ | DeeplabV3+ | | DDRNet23_slim | - | | | DDRNet23_slim_imagenet

| | | DDRNet23 | - | | | DDRNet23_imagenet | | | DDRNet39 | - | 79. 63% | - | DDRNet39_imagenet | DDRNet39 | Updating more model. Data preprocessing This project enables you to expose data sets: 、 The data set is uploaded later . **Cityscapes data set preparation is shown here:** 4. 1 Download the dataset Download the dataset from the link on the website, You can get suffix of original image under folder , 、 、 suffix of fine labeled image under folder . 2 Onehot encoding of label image The real label gray scale image Onehot encoding used

by the semantic segmentation task is 0-18, so the label needs to be encoded. Using scripts to process the image and get the result . png gtFine/train/cologne/cologne_000000_000019_gtFine_labelTrainIds. png leftImg8bit/train/cologne/cologne_000001_000019_leftImg8bit. png gtFine/train/cologne/cologne_000001_000019_gtFine_labelTrainIds. origin image path + the separator '\t' + label path + the separator '\n' sh train.

Frequently asked questions

How many stars and forks are recorded?

Deeachain/Segmentation-Pytorch has 520 stars and 75 forks.

What is the repository rank?

Deeachain/Segmentation-Pytorch is ranked 17,844.

What language and category are recorded?

Deeachain/Segmentation-Pytorch has 520 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

Deeachain/Segmentation-Pytorch is compared with OpenDriveLab/WorldEngine, ranked 17,846 with 520 stars.

README

:rocket: If it helps you, click a star! :star:

Update log

  • 2020.12.10 Project structure adjustment, the previous code has been deleted, the adjustment will be re-uploaded code
  • 2021.04.09 Re-upload the code, "V1 Commit"
  • 2021.04.22 update torch distributed training
  • Ongoing update .....

1. Display (Cityscapes)

  • Using model DDRNet 1525 test sets, official MIOU =78.4069%

Average results

Class results1

Class results2

Class results3

  • Comparison of the original and predicted images

origin

label

predict

2. Install

pip install -r requirements.txt

Experimental environment:

  • Ubuntu 16.04 Nvidia-Cards >= 1

  • python==3.6.5

  • See Dependency Installation Package for details in requirement.txt

3. Model

All the modeling is done in builders/model_builder.py

  • [x] FCN
  • [x] FCN_ResNet
  • [x] SegNet
  • [x] UNet
  • [x] BiSeNet
  • [x] BiSeNetV2
  • [x] PSPNet
  • [x] DeepLabv3_plus
  • [x] HRNet
  • [x] DDRNet
Model Backbone Val mIoU Test mIoU Imagenet Pretrain Pretrained Model
PSPNet ResNet 50 76.54% - √ PSPNet
DeeplabV3+ ResNet 50 77.78% - √ DeeplabV3+
DDRNet23_slim - DDRNet23_slim_imagenet
DDRNet23 - DDRNet23_imagenet
DDRNet39 - 79.63% - DDRNet39_imagenet DDRNet39
Updating more model.......

4. Data preprocessing

This project enables you to expose data sets: Cityscapes、ISPRS

The data set is uploaded later .....

Cityscapes data set preparation is shown here:

4.1 Download the dataset

Download the dataset from the link on the website, You can get *leftImg8bit.png suffix of original image under folder leftImg8bit, a) *color.png、b) *labelIds.png、c) *instanceIds.png suffix of fine labeled image under folder gtFine.

*leftImg8bit.png          : the origin picture
a) *color.png             : the class is encoded by its color
b) *labelIds.png          : the class is encoded by its ID
c) *instanceIds.png       : the class and the instance are encoded by an instance ID

4.2 Onehot encoding of label image

The real label gray scale image Onehot encoding used by the semantic segmentation task is 0-18, so the label needs to be encoded. Using scripts dataset/cityscapes/cityscapes_scripts/process_cityscapes.py to process the image and get the result *labelTrainIds.png. process_cityscapes.py usage: Modify 486 lines `Cityscapes_path'is the path to store your own data.

  • Comparison of original image, color label image and gray label image (0-18)

***_leftImg8bit

***_gtFine_color

***_gtFine_labelTrainIds

  • Local storage path display /data/open_data/cityscapes/:
data
  |--open_data
        |--cityscapes
               |--leftImg8bit
                    |--train
                        |--cologne
                        |--*******
                    |--val
                        |--*******
                    |--test
                        |--*******
               |--gtFine
                    |--train
                        |--cologne
                        |--*******
                    |--val
                        |--*******
                    |--test
                        |--*******

4.3 Generate image path

  • Generate a txt containing the image path

Use script dataset/generate_txt.py to generate the path txt file containing the original image and labels. A total of 3 txt files will be generated: cityscapes_train_list.txt、cityscapes_val_list.txt、 cityscapes_test_list.txt, and copy the three files to the dataset root directory.

data
  |--open_data
        |--cityscapes
               |--cityscapes_train_list.txt
               |--cityscapes_val_list.txt
               |--cityscapes_test_list.txt
               |--leftImg8bit
                    |--train
                        |--cologne
                        |--*******
                    |--val
                        |--*******
                    |--test
                        |--*******
               |--gtFine
                    |--train
                        |--cologne
                        |--*******
                    |--val
                        |--*******
                    |--test
                        |--*******
  • The contents of the txt are shown as follows:
leftImg8bit/train/cologne/cologne_000000_000019_leftImg8bit.png gtFine/train/cologne/cologne_000000_000019_gtFine_labelTrainIds.png
leftImg8bit/train/cologne/cologne_000001_000019_leftImg8bit.png gtFine/train/cologne/cologne_000001_000019_gtFine_labelTrainIds.png
..............
  • The format of the txt are shown as follows:
origin image path + the separator '\t' + label path +  the separator '\n'

TODO.....

5. How to train

sh train.sh

5.1 Parameters

python -m torch.distributed.launch --nproc_per_node=2 \
                train.py --model PSPNet_res50 --out_stride 8 \
                --max_epochs 200 --val_epochs 20 --batch_size 4 --lr 0.01 --optim sgd --loss ProbOhemCrossEntropy2d \
                --base_size 768 --crop_size 768  --tile_hw_size 768,768 \
                --root '/data/open_data' --dataset cityscapes --gpus_id 1,2

6. How to validate

sh predict.sh
Nearby in the ranking
Similar items