IOPLIN
June 13, 2023 ยท View on GitHub
Update:
- For Pytorch version of IOPLIN, see this.
- For more details of this task, see Pavement Distress Classification.
This repo is the official implementation of "Iteratively Optimized Patch Label Inference Network for Automatic Pavement Disease Detection" based on Keras and TensorFlow 1, and IOPLIN has published in: IEEE Transactions on Intelligent Transportation Systems. The source code is placed at /ioplin, the script is placed at /script, and the required mini dataset should place at /miniset.
For more details of the pavement dataset CQU-BPDD used in paper, please refer to CQU-BPDD. (Note: CQU-BPDD can be only used in the uncommercial case and is licensed under CC BY-NC-SA 4.0.)
Installation
Requirements (necessary)
python <= 3.7.9Keras == 2.2.4/TensorFlow <= 1.15.0keras_applications >= 1.0.7scikit-imageopencv-pythonefficientnet <= 0.0.3
Installing from the source
$ python setup.py install
Examples
- Initializing the model:
# models can be build with Keras
import ioplin
model = ioplin.init_model()
- Loading the pre-trained weights:
import ioplin
model = ioplin.load_model('path/to/model.h5')
- Predicting:
import ioplin
pre = ioplin.predict(model,data)
- Pretrain and train:
import ioplin
model = ioplin.pretrain(model,data_x,data_y)
model = ioplin.train(model,data_x,data_y)
Script
Simple application script of IOPLIN, and the required dataset and default model of IOPLIN can be downloaded from Google Drive
Pretrain
$ python pretrain.py --batch_size=32 --epoch=10
Train
$ python train.py --batch_size=32 --epoch=10 --path_pretrain_model=path/pretrain_model.h5
Predict
If you want to use the trained IOPLIN model to predict data, you should download the model file and enter:
$ python predict.py --path_model=path/trained_model.h5 --positive_index=0
If you want to use the IOPLIN model trained by yourself to predict data, you only need enter:
$ python predict.py --path_model=path/your_model.h5