This project aims at providing an easy-to-use, modifiable reference implementation for real-time semantic segmentation models using PyTorch.
PyTorch and Torchvision needs to be installed before running the scripts, PyTorch v1.1 or later is supported.
pip3 install -r requirements.txt
The project supports these semantic segmentation models as follows:
The project supports these loss functions:
- Weighted Cross Entropy
- Weighted Cross Entropy with Label Smooth
- Focal Loss
- Ohem Cross Entropy
- LovaszSoftmax
- SegLoss-List
- ...
The project supports these optimizers:
- SGD
- Adam
- AdamW
- RAdam
- RAdam + Lookahead
- ...
- ReLu
- PReLU
- ReLU6
- Swish
- Mish : A Self Regularized Non-Monotonic Neural Activation Function
- ...
The project supports these LR_Schedulers:
- Poly decay
- Warmup Poly
- ...
- pytorch-OpCounter
- flops-counter.pytorch
- Netron : Visualizer for neural network models, On line URL: Netron
- Falshtorch: Visualization toolkit for neural networks in PyTorch !
- Bag of Tricks for Image Classification with Convolutional Neural Networks
- ...
This project has been tailored to suit the Cityscapes and CamVid datasets. The folds of your dataset need satisfy the following structures:
|-- dataset
| |-- camvid
| | |-- train
| | |-- trainannot
| | |-- val
| | |-- valannot
| | |-- test
| | |-- testannot
| | |-- ...
| |-- cityscapes
| | |-- leftImg8bit
| | | |-- train
| | | |-- val
| | | |-- test
| | |-- gtFine
| | | |-- train
| | | |-- val
| | | |-- test
| | |-- ...
git clone https://github.com/xiaoyufenfei/Efficient-Segmentation-Networks
cd Efficient-Segmentation-Networks
Currently, the code supports Python 3
Torch dependencies:
Data dependencies:
Download Cityscapes and run the script createTrainIdLabelImgs.py
to create annotations based on the training labels. Make sure that the folder is named cityscapes
python train.py --help
python train.py --help
python test.py --help
python predict.py --help
cd tools
python trainID2labelID.py
If you think this work useful, please give me a star! And if you find any errors or have any suggestions, please contact me.
GitHub: xiaoyufenfei
Email: wangy314159@163.com
You are encouraged to cite the following papers if this work helps your research.
@misc{Efficient-Segmentation-Networks,
author = {Yu Wang},
title = {Efficient-Segmentation-Networks Pytorch Implementation},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/xiaoyufenfei/Efficient-Segmentation-Networks}},
commit = {master}
}
This project is released under the MIT License. See LICENSE for additional details.