Home

Awesome

Python 3.5 Packagist Last Commit Maintenance Contributing Open In Colab

DeepSegmentor

A Pytorch implementation of DeepCrack and RoadNet projects.

1.Datasets

Please download the corresponding dataset and prepare it by following the guidance.

2.Installation

We provide an user-friendly configuring method via Conda system, and you can create a new Conda environment using the command:

conda env create -f environment.yml

3.Balancing Weights

We follow the Median Frequency Balancing method, using the command:

python3 ./tools/calculate_weights.py --data_path <path_to_segmentation>

4.Training

Before the training, please download the dataset and copy it into the folder datasets.

sh ./scripts/train_deepcrack.sh <gpu_id>
sh ./scripts/train_roadnet.sh <gpu_id>

We provide our pretrained models here:

ModelGoogle DriveBaidu YunOthers
DeepCrack:ok_hand:[link]:ok_hand:[link](psw: 3fai)Fine-tuned
RoadNet:ok_hand:[link]:ok_hand:[link](psw: c2gi)Roughly trained
RoadNet++[link][link]-

5.Testing

sh ./scripts/test_deepcrack.sh <gpu_id>
ImageGround TruthGFfusedside1side2side3side4side5

[See more examples >>>]

sh ./scripts/test_roadnet.sh <gpu_id>
ImageGround TruthPrediction

[See more examples >>>]

6.Evaluation

MetricDescriptionUsage
PPrecision, TP/(TP+FP)segmentation
RRecall, TP/(TP+FN)segmentation
FF-score, 2PR/(P+R)segmentation
TPRTrue Positive Rate, TP/(TP+FN)segmentation
FPRFalse Positive Rate, FP/(FP+TN)segmentation
AUCThe Area Under the ROC Curvesegmentation
GGlobal accuracy, measures the percentage of the pixels correctly predictedsegmentation
CClass average accuracy, means the predictive accuracy over all classessegmentation
I/UMean intersection over unionsegmentation
ODSthe best F-measure on the dataset for a fixed scaleedge,centerline
OISthe aggregate F-measure on the dataset for the best scale in each imageedge,centerline
APthe average precision on the full recall rangeedge,centerline

Note: If you want to apply the standard non-maximum suppression (NMS) for edge/centerline thinning. Please see more details in Piotr's Structured Forest matlab toolbox or some helper functions provided in the hed/eval.

[See more details (Evaluation + Guided Filter + CRF) >>>]

Usage:

cd eval
python eval.py --metric_mode prf --model_name deepcrack --output deepcrack.prf

[Display the accuracy curves >>>]

Acknowledgment

References

If you take use of our datasets or code, please cite our papers:

@article{liu2019deepcrack,
  title={DeepCrack: A Deep Hierarchical Feature Learning Architecture for Crack Segmentation},
  author={Liu, Yahui and Yao, Jian and Lu, Xiaohu and Xie, Renping and Li, Li},
  journal={Neurocomputing},
  volume={338},
  pages={139--153},
  year={2019},
  doi={10.1016/j.neucom.2019.01.036}
}

@article{liu2019roadnet,
  title={RoadNet: Learning to Comprehensively Analyze Road Networks in Complex Urban Scenes from High-Resolution Remotely Sensed Images},
  author={Liu, Yahui and Yao, Jian and Lu, Xiaohu and Xia, Menghan and Wang, Xingbo and Liu, Yuan},
  journal={IEEE Transactions on Geoscience and Remote Sensing},
  volume={57},
  number={4},
  pages={2043--2056},
  year={2019},
  doi={10.1109/TGRS.2018.2870871}
}

If you have any questions, please contact me without hesitation (yahui.cvrs AT gmail.com).