- Python 3.x
- Tensorflow >= 1.21 or Tensorflow-gpu
- Numpy
- Scipy, Scikit-image
- Matplotlib
FCN_DatasetReader.py
: Classes for training dataset and test image readingFCN_layers.py
: Functions of layersFCN_model.py
: Model of FCNFCN_finetune.py
: Main training and test of FCNdata/train/*
: Folder for training dataset, contains subfolder 'image', 'annotation' and 'index.txt'data/valid/*
: Folder for validing dataset, contains subfolder 'image', 'annotation' and 'index.txt'logs
: Folder for training logscheckpoints
: Folder for model parameterstest
: Folder for test images
- Download pretrained model (https://drive.google.com/open?id=1oX7IO0R_ZkfHwZ_zV4c3_v9_24empwNz) and put into folder
checkpoints
- Put test images into folder
test
- Run
python FCN_finetune.py --mode=predict --test_dir=test
- Download vgg19 pretrained parameters into the root folder (https://drive.google.com/open?id=15WMDJbFWw3f1qMbTuDO1k4HQ0hyPB4-6)
- Prepare your own data or download crack dataset from (https://drive.google.com/open?id=1cplcUBmgHfD82YQTWnn1dssK2Z_xRpjx) If you need to change the training samples or validating sample, you can modify the
index.txt
file directly. Then put the data intodata/train/
anddata/valid/
respectively. - Run
python FCN_finetune.py --mode=finetune --learning_rate=1e-4 --num_of_epoch=20 --batch_size=2
- If you would like to check the training process, run
tensorboard --logdir=logs
, then openhttp://localhost:6006/
using any web explorer.
Please put 'index.txt' into train or valid folder as follows (The feeding process will follow this order):
image//0002.jpg,annotation//0002.png
image//0001.jpg,annotation//0001.png
Once you have got the predictions of cracks, go to python environment
from FCN_CrackAnalysis import CrackAnalyse
analyser = CrackAnalyse('test/001.png')
crack_skeleton = analyser.get_skeleton()
crack_lenth = analyser.get_crack_length()
crack_max_width = analyser.get_crack_max_width()
crack_mean_width = analyser.get_crack_mean_width()
Then you can using matplotlib to show the skeleton and print the crack morphological features.