change path
This commit is contained in:
39
.ipynb_checkpoints/Example_prediction-checkpoint.ipynb
Normal file
39
.ipynb_checkpoints/Example_prediction-checkpoint.ipynb
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Example of load model for detections"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.6.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
||||||
39
Example_prediction.ipynb
Normal file
39
Example_prediction.ipynb
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Example of load model for detections"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.6.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
||||||
14
README.md
14
README.md
@@ -25,7 +25,7 @@ The models used for detection are SSD [SSD: Single Shot MultiBox Detector](https
|
|||||||
* [SSD_Keras](https://github.com/pierluigiferrari/ssd_keras#how-to-fine-tune-one-of-the-trained-models-on-your-own-dataset)
|
* [SSD_Keras](https://github.com/pierluigiferrari/ssd_keras#how-to-fine-tune-one-of-the-trained-models-on-your-own-dataset)
|
||||||
* [YOLOv3_Keras](https://github.com/experiencor/keras-yolo3)
|
* [YOLOv3_Keras](https://github.com/experiencor/keras-yolo3)
|
||||||
|
|
||||||
Grab the pretrained weights of SSD and YOLO3 from https://drive.google.com/drive/folders/1LSc9FkAwJrAAT8pAUWz8aax_biFAMMXS?usp=sharing
|
Grab the pretrained weights of SSD and YOLO3 from [Drive_Weights](https://drive.google.com/drive/folders/1LSc9FkAwJrAAT8pAUWz8aax_biFAMMXS?usp=sharing)
|
||||||
|
|
||||||
## Type of Data
|
## Type of Data
|
||||||
The images used for the design of this model were extracted by air analysis, specifically: FLIR aerial radiometric thermal infrared pictures, taken by UAV (R-JPEG format). Which were converted into .jpg images for the training of these detection models.
|
The images used for the design of this model were extracted by air analysis, specifically: FLIR aerial radiometric thermal infrared pictures, taken by UAV (R-JPEG format). Which were converted into .jpg images for the training of these detection models.
|
||||||
@@ -172,10 +172,10 @@ The evaluation is integrated into the training process, if you want to do the in
|
|||||||
Compute the mAP performance of the model defined in `saved_weights_name` on the validation dataset defined in `valid_image_folder` and `valid_annot_folder`.
|
Compute the mAP performance of the model defined in `saved_weights_name` on the validation dataset defined in `valid_image_folder` and `valid_annot_folder`.
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
All of weights of this trained model grab from https://drive.google.com/drive/folders/1LSc9FkAwJrAAT8pAUWz8aax_biFAMMXS?usp=sharing
|
All of weights of this trained model grab from [Drive_Weights](https://drive.google.com/drive/folders/1LSc9FkAwJrAAT8pAUWz8aax_biFAMMXS?usp=sharing)
|
||||||
## Panel Detector
|
## Panel Detector
|
||||||
### SDD7
|
### SDD7
|
||||||
On folder Result_ssd7_panel show code (jupyter notebook), weight and result of this model (mAP 89.8%).
|
On folder [Result ssd7 panel](Result_ssd7_panel/) show code (jupyter notebook), weight and result of this model (mAP 89.8%).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -183,14 +183,14 @@ On folder Result_ssd7_panel show code (jupyter notebook), weight and result of t
|
|||||||
|
|
||||||
## Soiling Fault Detector
|
## Soiling Fault Detector
|
||||||
### SSD300
|
### SSD300
|
||||||
On folder Result_ssd300_fault_1 show code (jupyter notebook), weight and result of this model (mAP 79.5%).
|
On folder [Result ssd300 fault 1](Result_ssd300_fault_1/) show code (jupyter notebook), weight and result of this model (mAP 79.5%).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### YOLO3
|
### YOLO3
|
||||||
On folder Result_yolo3_fault_1 show history train (yolo3_full_yolo.output), weight and result of this model (mAP 73.02%).
|
On folder [Result yolo3 fault 1](Result_yolo3_fault_1/) show [history train](Result_yolo3_fault_1/yolo3_full_yolo.output), weight and result of this model (mAP 73.02%).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
@@ -198,7 +198,7 @@ On folder Result_yolo3_fault_1 show history train (yolo3_full_yolo.output), weig
|
|||||||
|
|
||||||
## Diode Fault Detector
|
## Diode Fault Detector
|
||||||
### YOLO3
|
### YOLO3
|
||||||
On folder Result_yolo3_fault_4 show history train (yolo3_full_yolo.output), weight and result of this model (mAP 73.02%).
|
On folder [Result yolo3 fault 4](Result_yolo3_fault_4/) show [history train](Result_yolo3_fault_4/yolo3_full_yolo.output), weight and result of this model (mAP 73.02%).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -221,4 +221,4 @@ Before sending your pull requests, make sure you followed this list.
|
|||||||
|
|
||||||
# Example to use trained model
|
# Example to use trained model
|
||||||
|
|
||||||
In ['Example_Prediction'](ex_prediction.ipynb)
|
In ['Example_Prediction'](Example_prediction.ipynb)
|
||||||
|
|||||||
@@ -6,29 +6,29 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"train": {
|
"train": {
|
||||||
"train_image_folder": "../Train&Test_D/Train/images",
|
"train_image_folder": "Train&Test_D/Train/images",
|
||||||
"train_annot_folder": "../Train&Test_D/Train/anns",
|
"train_annot_folder": "Train&Test_D/Train/anns",
|
||||||
"train_image_set_filename": "../Train&Test_D/Train/train.txt",
|
"train_image_set_filename": "Train&Test_D/Train/train.txt",
|
||||||
|
|
||||||
"train_times": 1,
|
"train_times": 1,
|
||||||
"batch_size": 12,
|
"batch_size": 12,
|
||||||
"learning_rate": 1e-4,
|
"learning_rate": 1e-4,
|
||||||
"warmup_epochs": 3,
|
"warmup_epochs": 3,
|
||||||
|
|
||||||
"nb_epochs": 100,
|
"nb_epochs": 100,
|
||||||
"saved_weights_name": "../Result_ssd300_fault_4/ssd300_fault_4.h5",
|
"saved_weights_name": "Result_ssd300_fault_4/ssd300_fault_4.h5",
|
||||||
"debug": false
|
"debug": false
|
||||||
},
|
},
|
||||||
"valid": {
|
"valid": {
|
||||||
"valid_image_folder": "../Train&Test_D/Test/images/",
|
"valid_image_folder": "Train&Test_D/Test/images/",
|
||||||
"valid_annot_folder": "../Train&Test_D/Test/anns/",
|
"valid_annot_folder": "Train&Test_D/Test/anns/",
|
||||||
"valid_image_set_filename": "../Train&Test_D/Test/test.txt"
|
"valid_image_set_filename": "Train&Test_D/Test/test.txt"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
"test": {
|
"test": {
|
||||||
"test_image_folder": "../Train&Test_D/Test/images",
|
"test_image_folder": "Train&Test_D/Test/images",
|
||||||
"test_annot_folder": "../Train&Test_D/Test/anns",
|
"test_annot_folder": "Train&Test_D/Test/anns",
|
||||||
"test_image_set_filename": "../Train&Test_D/Test/test.txt"
|
"test_image_set_filename": "Train&Test_D/Test/test.txt"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
"max_input_size": 400,
|
"max_input_size": 400,
|
||||||
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
||||||
"labels": ["1"],
|
"labels": ["1"],
|
||||||
"backend": "full_yolo_backend.h5"
|
"backend": "keras-yolo3-master/full_yolo_backend.h5"
|
||||||
},
|
},
|
||||||
|
|
||||||
"train": {
|
"train": {
|
||||||
"train_image_folder": "../Train&Test_S/Train/images/",
|
"train_image_folder": "Train&Test_S/Train/images/",
|
||||||
"train_annot_folder": "../Train&Test_S/Train/anns/",
|
"train_annot_folder": "Train&Test_S/Train/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/experimento_fault_1_gpu.pkl",
|
"cache_name": "Result_yolo3_fault_1/experimento_fault_1_gpu.pkl",
|
||||||
|
|
||||||
"train_times": 1,
|
"train_times": 1,
|
||||||
|
|
||||||
@@ -33,16 +33,16 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"valid": {
|
"valid": {
|
||||||
"valid_image_folder": "../Train&Test_S/Test/images/",
|
"valid_image_folder": "Train&Test_S/Test/images/",
|
||||||
"valid_annot_folder": "../Train&Test_S/Test/anns/",
|
"valid_annot_folder": "Train&Test_S/Test/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/val_fault_1.pkl",
|
"cache_name": "Result_yolo3_fault_1/val_fault_1.pkl",
|
||||||
|
|
||||||
"valid_times": 1
|
"valid_times": 1
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"test_image_folder": "../Train&Test_S/Test/images/",
|
"test_image_folder": "Train&Test_S/Test/images/",
|
||||||
"test_annot_folder": "../Train&Test_S/Test/anns/",
|
"test_annot_folder": "Train&Test_S/Test/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/test_fault_1.pkl",
|
"cache_name": "Result_yolo3_fault_1/test_fault_1.pkl",
|
||||||
|
|
||||||
"test_times": 1
|
"test_times": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
"max_input_size": 400,
|
"max_input_size": 400,
|
||||||
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
||||||
"labels": ["1"],
|
"labels": ["1"],
|
||||||
"backend": "full_yolo_backend.h5"
|
"backend": "keras-yolo3-master/full_yolo_backend.h5"
|
||||||
},
|
},
|
||||||
|
|
||||||
"train": {
|
"train": {
|
||||||
"train_image_folder": "../Train&Test_S/Train/images/",
|
"train_image_folder": "Train&Test_S/Train/images/",
|
||||||
"train_annot_folder": "../Train&Test_S/Train/anns/",
|
"train_annot_folder": "Train&Test_S/Train/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/experimento_fault_1_gpu.pkl",
|
"cache_name": "Result_yolo3_fault_1/experimento_fault_1_gpu.pkl",
|
||||||
|
|
||||||
"train_times": 1,
|
"train_times": 1,
|
||||||
|
|
||||||
@@ -28,21 +28,21 @@
|
|||||||
"class_scale": 1,
|
"class_scale": 1,
|
||||||
|
|
||||||
"tensorboard_dir": "log_experimento_fault_gpu",
|
"tensorboard_dir": "log_experimento_fault_gpu",
|
||||||
"saved_weights_name": "../Result_yolo3_fault_1/yolo3_full_fault_1.h5",
|
"saved_weights_name": "Result_yolo3_fault_1/yolo3_full_fault_1.h5",
|
||||||
"debug": true
|
"debug": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"valid": {
|
"valid": {
|
||||||
"valid_image_folder": "../Train&Test_S/Test/images/",
|
"valid_image_folder": "Train&Test_S/Test/images/",
|
||||||
"valid_annot_folder": "../Train&Test_S/Test/anns/",
|
"valid_annot_folder": "Train&Test_S/Test/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/val_fault_1.pkl",
|
"cache_name": "Result_yolo3_fault_1/val_fault_1.pkl",
|
||||||
|
|
||||||
"valid_times": 1
|
"valid_times": 1
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"test_image_folder": "../Train&Test_S/Test/images/",
|
"test_image_folder": "Train&Test_S/Test/images/",
|
||||||
"test_annot_folder": "../Train&Test_S/Test/anns/",
|
"test_annot_folder": "Train&Test_S/Test/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_1/test_fault_1.pkl",
|
"cache_name": "Result_yolo3_fault_1/test_fault_1.pkl",
|
||||||
|
|
||||||
"test_times": 1
|
"test_times": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
"max_input_size": 400,
|
"max_input_size": 400,
|
||||||
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
"anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21],
|
||||||
"labels": ["4"],
|
"labels": ["4"],
|
||||||
"backend": "full_yolo_backend.h5"
|
"backend": "keras-yolo3-master/full_yolo_backend.h5"
|
||||||
},
|
},
|
||||||
|
|
||||||
"train": {
|
"train": {
|
||||||
"train_image_folder": "../Train&Test_D/Train/images/",
|
"train_image_folder": "Train&Test_D/Train/images/",
|
||||||
"train_annot_folder": "../Train&Test_D/Train/anns/",
|
"train_annot_folder": "Train&Test_D/Train/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_4/Result_yolo3_fault_4.pkl",
|
"cache_name": "Result_yolo3_fault_4/Result_yolo3_fault_4.pkl",
|
||||||
|
|
||||||
"train_times": 1,
|
"train_times": 1,
|
||||||
|
|
||||||
@@ -33,9 +33,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"valid": {
|
"valid": {
|
||||||
"valid_image_folder": "../Train&Test_D/Test/images/",
|
"valid_image_folder": "Train&Test_D/Test/images/",
|
||||||
"valid_annot_folder": "../Train&Test_D/Test/anns/",
|
"valid_annot_folder": "Train&Test_D/Test/anns/",
|
||||||
"cache_name": "../Result_yolo3_fault_4/Result_yolo3_fault_4.pkl",
|
"cache_name": "Result_yolo3_fault_4/Result_yolo3_fault_4.pkl",
|
||||||
|
|
||||||
"valid_times": 1
|
"valid_times": 1
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ def _main_(args):
|
|||||||
makedirs(output_path)
|
makedirs(output_path)
|
||||||
|
|
||||||
print ('Training ssd')
|
print ('Training ssd')
|
||||||
os.system('cd ssd_keras-master/ && python train.py -c ../' + config_path + ' > ../' + output_path + '/ssd.output 2> ../' + output_path +'/ssd.err')
|
os.system('python ssd_keras-master/train.py -c ' + config_path + ' > ' + output_path + '/ssd.output 2> ' + output_path +'/ssd.err')
|
||||||
print ('Testing ssd')
|
print ('Testing ssd')
|
||||||
os.system('cd ssd_keras-master/ && python evaluate.py -c ../' + config_path + ' > ../' + output_path + '/ssd_test.output 2> ../' + output_path +'/ssd_test.err')
|
os.system('python ssd_keras-master/evaluate.py -c ' + config_path + ' > ' + output_path + '/ssd_test.output 2> ' + output_path +'/ssd_test.err')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@@ -32,4 +32,3 @@ if __name__ == '__main__':
|
|||||||
argparser.add_argument('-o', '--output', help='path to save the experiment')
|
argparser.add_argument('-o', '--output', help='path to save the experiment')
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
_main_(args)
|
_main_(args)
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ def _main_(args):
|
|||||||
makedirs(output_path)
|
makedirs(output_path)
|
||||||
|
|
||||||
print ('Training full_yolo3')
|
print ('Training full_yolo3')
|
||||||
os.system('cd keras-yolo3-master/ && python train.py -c ../' + config_path + ' > ../' + output_path + '/yolo3_full_yolo.output 2> ../' + output_path +'/yolo3_full_yolo.err')
|
os.system('python keras-yolo3-master/train.py -c ' + config_path + ' > ' + output_path + '/yolo3_full_yolo.output 2> ' + output_path +'/yolo3_full_yolo.err')
|
||||||
print('Test full_yolo3')
|
print('Test full_yolo3')
|
||||||
os.system('cd keras-yolo3-master/ && python evaluate.py -c ../' + config_path+ ' > ../' + output_path + '/yolo3_full_yolo_test.output 2> ../' + output_path +'/yolo3_full_yolo_test.err')
|
os.system('python keras-yolo3-master/evaluate.py -c ' + config_path+ ' > ' + output_path + '/yolo3_full_yolo_test.output 2> ' + output_path +'/yolo3_full_yolo_test.err')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
argparser = argparse.ArgumentParser(description='train and evaluate ssd model on any dataset')
|
argparser = argparse.ArgumentParser(description='train and evaluate ssd model on any dataset')
|
||||||
|
|||||||
Reference in New Issue
Block a user