Coder Social home page Coder Social logo

deepsegmentor's Introduction

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.

  • Crack Detection
sh ./scripts/train_deepcrack.sh <gpu_id>
  • Road Detection
sh ./scripts/train_roadnet.sh <gpu_id>

We provide our pretrained models here:

Model Google Drive Baidu Yun Others
DeepCrack ๐Ÿ‘Œ[link] ๐Ÿ‘Œ[link](psw: 3fai) Fine-tuned
RoadNet ๐Ÿ‘Œ[link] ๐Ÿ‘Œ[link](psw: c2gi) Roughly trained
RoadNet++ [link] [link] -

5.Testing

  • Crack Detection
sh ./scripts/test_deepcrack.sh <gpu_id>
Image Ground Truth GF fused side1 side2 side3 side4 side5

[See more examples >>>]

  • Road Detection
sh ./scripts/test_roadnet.sh <gpu_id>
Image Ground Truth Prediction

[See more examples >>>]

6.Evaluation

  • Metrics (appeared in our papers):
Metric Description Usage
P Precision, TP/(TP+FP) segmentation
R Recall, TP/(TP+FN) segmentation
F F-score, 2PR/(P+R) segmentation
TPR True Positive Rate, TP/(TP+FN) segmentation
FPR False Positive Rate, FP/(FP+TN) segmentation
AUC The Area Under the ROC Curve segmentation
G Global accuracy, measures the percentage of the pixels correctly predicted segmentation
C Class average accuracy, means the predictive accuracy over all classes segmentation
I/U Mean intersection over union segmentation
ODS the best F-measure on the dataset for a fixed scale edge,centerline
OIS the aggregate F-measure on the dataset for the best scale in each image edge,centerline
AP the average precision on the full recall range edge,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

This code is based on the pytorch-CycleGAN-and-pix2pix. Thanks to the contributors of this project.

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.liu AT unitn.it).

deepsegmentor's People

Contributors

yhlleo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.