DataFlit to XML 2

This commit is contained in:
Daniel Saavedra
2020-01-26 22:26:13 -03:00
parent 64a4712ec1
commit 2d3f2f7f3b
4 changed files with 138 additions and 54 deletions

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@ result_ssd7_panel_1/
result_ssd7_panel_2/
Train&Test_A/
Train&Test_B/
Train&Test_C/
result_ssd7_panel/
result_ssd7_panel_cell/
Thermal/

View File

@@ -71,11 +71,18 @@ def _main_(args):
if not pandas.notna(Excel.Archivo[index_path]):
continue
path_Flir = Excel.loc[index_path]['Archivo']
cod_falla = int(Excel.loc[index_path]['Cód. Falla'])
sev = Excel.loc[index_path]['Severidad']
path_Flir_aux = thermal_path + '/'.join(path_Flir.split('/')[-2:])
## Junta las mismas fotos con distintos label EJ :
# DJI_0021B ---> DJI_0021
aux = path_Flir.split('/')[-2:]
if len(aux[1].split('.')[0]) > 8:
aux[1] = aux[1].split('.')[0][:8] + '.' + aux[1].split('.')[1]
path_Flir_aux = thermal_path + '/'.join(aux)
if not os.path.isfile(path_Flir_aux):
print ('No existe la imagen', path_Flir_aux)
@@ -102,8 +109,8 @@ def _main_(args):
param_bbox.append(list(map(int, dic_data['Meas' + str(num_bbox) + 'Params'].split(' '))))
##### Save Image and create XML annotations type of fault
path_save_img = output_path + 'images/' + '_'.join(path_Flir.split('/')[-2:])
path_save_anns = output_path + 'anns/' + '_'.join(path_Flir.split('/')[-2:])
path_save_img = output_path + 'images/' + '_'.join(aux)
path_save_anns = output_path + 'anns/' + '_'.join(aux)
path_save_anns = path_save_anns[:-4] + '.xml'
if not os.path.isfile(path_save_img):

View File

@@ -850,7 +850,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 28,
"metadata": {},
"outputs": [
{
@@ -895,7 +895,82 @@
"\n",
"Producing predictions batch-wise: 18%|█▊ | 3/17 [00:59<04:34, 19.60s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 24%|██▎ | 4/17 [01:18<04:08, 19.13s/it]\u001b[A\u001b[A"
"Producing predictions batch-wise: 24%|██▎ | 4/17 [01:18<04:08, 19.13s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 29%|██▉ | 5/17 [01:36<03:46, 18.91s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 35%|███▌ | 6/17 [01:55<03:29, 19.09s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 41%|████ | 7/17 [02:16<03:16, 19.68s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 47%|████▋ | 8/17 [02:36<02:57, 19.73s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 53%|█████▎ | 9/17 [02:55<02:36, 19.51s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 59%|█████▉ | 10/17 [03:14<02:14, 19.19s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 65%|██████▍ | 11/17 [03:33<01:54, 19.13s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 71%|███████ | 12/17 [03:53<01:37, 19.42s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 76%|███████▋ | 13/17 [04:13<01:18, 19.53s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 82%|████████▏ | 14/17 [04:31<00:57, 19.25s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 88%|████████▊ | 15/17 [04:51<00:38, 19.40s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 94%|█████████▍| 16/17 [05:09<00:19, 19.12s/it]\u001b[A\u001b[A\n",
"\n",
"Producing predictions batch-wise: 100%|██████████| 17/17 [05:23<00:00, 17.60s/it]\u001b[A\u001b[A\n",
"\n",
" 0%| | 0/13400 [00:00<?, ?it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 0%| | 0/13400 [00:00<?, ?it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 9%|▉ | 1205/13400 [00:00<00:01, 12042.06it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 18%|█▊ | 2448/13400 [00:00<00:00, 12154.75it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 26%|██▋ | 3536/13400 [00:00<00:00, 11741.99it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 36%|███▌ | 4827/13400 [00:00<00:00, 12069.46it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 45%|████▌ | 6052/13400 [00:00<00:00, 12122.20it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 53%|█████▎ | 7066/13400 [00:00<00:00, 11271.86it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 60%|██████ | 8066/13400 [00:00<00:00, 10481.38it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 68%|██████▊ | 9167/13400 [00:00<00:00, 10634.41it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 76%|███████▋ | 10233/13400 [00:00<00:00, 10641.74it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 84%|████████▍ | 11317/13400 [00:01<00:00, 10698.40it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 93%|█████████▎| 12409/13400 [00:01<00:00, 10763.24it/s]\u001b[A\u001b[A\n",
"\n",
"Matching predictions to ground truth, class 1/8.: 100%|██████████| 13400/13400 [00:01<00:00, 10908.63it/s]\u001b[A\u001b[ANo predictions for class 2/8\n",
"No predictions for class 3/8\n",
"No predictions for class 4/8\n",
"No predictions for class 5/8\n",
"No predictions for class 6/8\n",
"No predictions for class 7/8\n",
"No predictions for class 8/8\n",
"Computing precisions and recalls, class 1/8\n",
"Computing precisions and recalls, class 2/8\n"
]
},
{
"ename": "IndexError",
"evalue": "list index out of range",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-28-7b51ac359b0d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0mreturn_recalls\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 85\u001b[0m \u001b[0mreturn_average_precisions\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 86\u001b[0;31m verbose=True)\n\u001b[0m\u001b[1;32m 87\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 88\u001b[0m \u001b[0mmean_average_precision\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maverage_precisions\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprecisions\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrecalls\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresults\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Desktop/Rentadrone.cl-ai-test/ssd_keras-master/eval_utils/average_precision_evaluator.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, img_height, img_width, batch_size, data_generator_mode, round_confidences, matching_iou_threshold, border_pixels, sorting_algorithm, average_precision_mode, num_recall_points, ignore_neutral_boxes, return_precisions, return_recalls, return_average_precisions, verbose, decoding_confidence_thresh, decoding_iou_threshold, decoding_top_k, decoding_pred_coords, decoding_normalize_coords)\u001b[0m\n\u001b[1;32m 224\u001b[0m \u001b[0;31m#############################################################################################\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 225\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 226\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcompute_precision_recall\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mret\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 227\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;31m#############################################################################################\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Desktop/Rentadrone.cl-ai-test/ssd_keras-master/eval_utils/average_precision_evaluator.py\u001b[0m in \u001b[0;36mcompute_precision_recall\u001b[0;34m(self, verbose, ret)\u001b[0m\n\u001b[1;32m 765\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Computing precisions and recalls, class {}/{}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mclass_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mn_classes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 766\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 767\u001b[0;31m \u001b[0mtp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcumulative_true_positives\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mclass_id\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 768\u001b[0m \u001b[0mfp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcumulative_false_positives\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mclass_id\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 769\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mIndexError\u001b[0m: list index out of range"
]
}
],

1
command_train Normal file
View File

@@ -0,0 +1 @@
ls images | sed -e 's/\..*$//' > train.txt