thsant / wgisd

Embrapa Wine Grape Instance Segmentation Dataset - Embrapa WGISD
Other
123 stars 39 forks source link

Porting to VOC generate wrong boxes #1

Closed SalahAdDin closed 3 years ago

SalahAdDin commented 4 years ago

Hello,

I'm testing this dataset, thank you for making it public, in order to compare it against different machine learning frameworks, and for making it easier to use in these, I tried to port this dataset to a more standard PASCAL VOC format.

Therefore, I made this script to port it. You can see my fork and see the results.

Unfortunately, when I test it with RetinaNet I get the next results:

Using TensorFlow backend.
2020-01-28 11:47:40.487381: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 166 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  5.27859013e+02  7.76165760e+01  6.84264807e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 172 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.50445085e+02  5.62846080e+01  7.01247455e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 175 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.70045603e+02  1.41223360e+02  8.71873137e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 182 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.603712  248.2237475  53.518784  602.1122825]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 183 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  7.32845157e+02  1.15542464e+02  8.32376863e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 55 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      363.93275  85.016   617.95925]
 [222.9488   -0.93175 386.9936   80.01275]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 57 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.8359536e+03 -9.3175000e-01  2.0389104e+03  2.6401475e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 58 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  3.040775e+02  1.459440e+02  6.060155e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 59 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.8976 585.95    32.0752 646.01  ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 226 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.66490460e+02  1.10408128e+02  9.44546420e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 228 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.71773892e+02  1.00136384e+02  6.13565997e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 235 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.603712 394.359965  85.914048 523.513535]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 157 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  3.62367777e+02  1.51493056e+02  8.69897983e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 158 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.50298147e+02  4.64081280e+01  7.78661382e+02]
 [-6.03712000e-01  8.07099110e+02  5.78646400e+01  1.02551549e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 134 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  4.37016215e+02  2.47097792e+02  6.58987055e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 135 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  8.30401707e+02  1.36877504e+02  1.00023637e+03]
 [-6.03712000e-01  3.58813318e+02  9.02599040e+01  6.79920012e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 145 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.80462118e+02  1.05272768e+02  7.26130723e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 154 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.08383994e+03 -6.04832500e-01  1.36709882e+03  1.68045012e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 194 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  6.38449265e+02  8.03824000e+01  7.51804325e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 195 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  5.06530887e+02  9.30257280e+01  9.40992642e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 198 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  7.17441815e+02  7.05059200e+01  8.46595385e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 199 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  5.80784158e+02  2.00481216e+02  8.04334303e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 200 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  7.73131085e+02  1.06456512e+02  1.00497634e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 51 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-1.0000000e+00  7.5097850e+02  4.4056000e+01  1.0419965e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 184 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  4.71889088e+02  1.16334016e+02  6.76587200e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 201 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  7.81221824e+02  1.13286592e+02  9.65603264e+02]
 [-4.92096000e-01  4.36332992e+02  7.21422720e+01  6.21221312e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 238 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  2.810090e+02  1.819888e+02  6.719450e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 94 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.2990704e+03 -1.0000000e+00  1.5390960e+03  3.9403100e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 96 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      218.96975  91.9792  485.00825]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 63 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  7.598600e+01  2.548976e+02  4.060430e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 70 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      749.95475  94.0272  961.93925]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 18 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.1024 734.0525 110.9232 854.9915]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 23 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      478.04675 134.9872  628.06025]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 76 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-1.0000000e+00  7.5409760e+02  1.1409760e+02  1.0800368e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 77 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  6.319856e+02  1.369328e+02  9.490160e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 13 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     756.029  119.0128 875.057 ]
 [ -0.8976 407.954  157.0032 644.918 ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 121 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.12380495e+02  8.70988160e+01  8.53704305e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 113 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  7.65477056e+02  1.37158080e+02  1.03519098e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 115 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  1.13169862e+03  4.82707840e+01  1.33538144e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 118 (shape (1536, 2048, 3)) contains the following invalid boxes: [[ -1.     497.048  245.9888 730.0592]
 [ -1.     689.048  153.0096 954.008 ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 131 (shape (1536, 2048, 3)) contains the following invalid boxes: [[1368.905152 1085.984192 1368.905152 1087.507904]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 108 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.69650435e+02  5.35187840e+01  7.42718885e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 86 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-1.00000000e+00  7.60055750e+02  1.59972800e+02  1.04001725e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 90 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.84000000e-02  5.40017750e+02  1.09899200e+02  1.10308025e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 132 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.91072000e-01  5.92270784e+02  2.88016832e+02  1.14338144e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 168 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  5.96333504e+02  1.25984192e+02  7.27888832e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 112 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  5.61429823e+02  5.23329920e+01  7.19416287e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 190 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  3.55258858e+02  1.22653120e+02  6.93348883e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 192 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.35289972e+02  7.48517760e+01  7.37980288e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 28 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     591.0005  71.9088 765.9935]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 29 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.8976  566.90825  73.0352  669.96575]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 31 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     631.9505  57.9824 839.9765]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 34 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.1024  525.95825  85.9376  690.98675]].
  annotations['bboxes'][invalid_indices, :]
Running network: N/A% (0 of 58) |        | Elapsed Time: 0:00:00 ETA:  --:--:--keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 76 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-1.0000000e+00  7.5409760e+02  1.1409760e+02  1.0800368e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 77 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  6.319856e+02  1.369328e+02  9.490160e+02]].
  annotations['bboxes'][invalid_indices, :]
Running network:  12% (7 of 58) |        | Elapsed Time: 0:00:08 ETA:   0:00:21keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 112 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  5.61429823e+02  5.23329920e+01  7.19416287e+02]].
  annotations['bboxes'][invalid_indices, :]
Running network:  56% (33 of 58) |###    | Elapsed Time: 0:00:19 ETA:   0:00:11keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 157 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  3.62367777e+02  1.51493056e+02  8.69897983e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 158 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.50298147e+02  4.64081280e+01  7.78661382e+02]
 [-6.03712000e-01  8.07099110e+02  5.78646400e+01  1.02551549e+03]].
  annotations['bboxes'][invalid_indices, :]
Running network: 100% (58 of 58) |#######| Elapsed Time: 0:00:30 Time:  0:00:30
Parsing annotations: 100% (58 of 58) |###| Elapsed Time: 0:00:00 Time:  0:00:00
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 113 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  7.65477056e+02  1.37158080e+02  1.03519098e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 115 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  1.13169862e+03  4.82707840e+01  1.33538144e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 118 (shape (1536, 2048, 3)) contains the following invalid boxes: [[ -1.     497.048  245.9888 730.0592]
 [ -1.     689.048  153.0096 954.008 ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 131 (shape (1536, 2048, 3)) contains the following invalid boxes: [[1368.905152 1085.984192 1368.905152 1087.507904]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 94 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.2990704e+03 -1.0000000e+00  1.5390960e+03  3.9403100e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 96 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      218.96975  91.9792  485.00825]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 154 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.08383994e+03 -6.04832500e-01  1.36709882e+03  1.68045012e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 63 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  7.598600e+01  2.548976e+02  4.060430e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 70 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      749.95475  94.0272  961.93925]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 175 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.70045603e+02  1.41223360e+02  8.71873137e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 182 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.603712  248.2237475  53.518784  602.1122825]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 183 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  7.32845157e+02  1.15542464e+02  8.32376863e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 18 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.1024 734.0525 110.9232 854.9915]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 23 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      478.04675 134.9872  628.06025]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 108 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.69650435e+02  5.35187840e+01  7.42718885e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 13 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     756.029  119.0128 875.057 ]
 [ -0.8976 407.954  157.0032 644.918 ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 238 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  2.810090e+02  1.819888e+02  6.719450e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 134 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  4.37016215e+02  2.47097792e+02  6.58987055e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 135 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  8.30401707e+02  1.36877504e+02  1.00023637e+03]
 [-6.03712000e-01  3.58813318e+02  9.02599040e+01  6.79920012e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 145 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.80462118e+02  1.05272768e+02  7.26130723e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 121 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.12380495e+02  8.70988160e+01  8.53704305e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 55 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.      363.93275  85.016   617.95925]
 [222.9488   -0.93175 386.9936   80.01275]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 57 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ 1.8359536e+03 -9.3175000e-01  2.0389104e+03  2.6401475e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 58 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.840000e-02  3.040775e+02  1.459440e+02  6.060155e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 59 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.8976 585.95    32.0752 646.01  ]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 51 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-1.0000000e+00  7.5097850e+02  4.4056000e+01  1.0419965e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 132 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.91072000e-01  5.92270784e+02  2.88016832e+02  1.14338144e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 168 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  5.96333504e+02  1.25984192e+02  7.27888832e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 28 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     591.0005  71.9088 765.9935]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 29 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.8976  566.90825  73.0352  669.96575]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 31 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.     631.9505  57.9824 839.9765]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 34 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -1.1024  525.95825  85.9376  690.98675]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 190 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  3.55258858e+02  1.22653120e+02  6.93348883e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 192 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  6.35289972e+02  7.48517760e+01  7.37980288e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 194 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  6.38449265e+02  8.03824000e+01  7.51804325e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 195 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  5.06530887e+02  9.30257280e+01  9.40992642e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 198 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  7.17441815e+02  7.05059200e+01  8.46595385e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 199 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.05760000e-01  5.80784158e+02  2.00481216e+02  8.04334303e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 200 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  7.73131085e+02  1.06456512e+02  1.00497634e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 226 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.03712000e-01  6.66490460e+02  1.10408128e+02  9.44546420e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 228 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.71773892e+02  1.00136384e+02  6.13565997e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 235 (shape (1365, 2048, 3)) contains the following invalid boxes: [[ -0.603712 394.359965  85.914048 523.513535]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 86 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-1.00000000e+00  7.60055750e+02  1.59972800e+02  1.04001725e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 90 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-7.84000000e-02  5.40017750e+02  1.09899200e+02  1.10308025e+03]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 166 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  5.27859013e+02  7.76165760e+01  6.84264807e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 172 (shape (1365, 2048, 3)) contains the following invalid boxes: [[-6.04736000e-01  4.50445085e+02  5.62846080e+01  7.01247455e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 184 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  4.71889088e+02  1.16334016e+02  6.76587200e+02]].
  annotations['bboxes'][invalid_indices, :]
keras_retinanet/bin/../../keras_retinanet/preprocessing/generator.py:180: UserWarning: Image with id 201 (shape (1536, 2048, 3)) contains the following invalid boxes: [[-4.92096000e-01  7.81221824e+02  1.13286592e+02  9.65603264e+02]
 [-4.92096000e-01  4.36332992e+02  7.21422720e+01  6.21221312e+02]].
  annotations['bboxes'][invalid_indices, :]

Unfortunately, I cannot guess which annotation files have these mistakes, which makes it so hard to discover the problem. Thas why I'm writing this issue.

I didn't test these results in other frameworks yet, but I can guess they will be problematic too.

Thanks

thsant commented 4 years ago

Dear @SalahAdDin ,

The wrong boxes that RetinaNet is complaining about are that ones presenting negative coordinates. I have checked the conversion formulas in your code and they are right (lines 52 to 62). Please, look your XML files and give me a few examples of them presenting negative values for x_min (I need the name of the image/txt file).

Best Regards

th

SalahAdDin commented 4 years ago

@thsant

Thanks,

Right now, i'm working in a way got ther which images presents this cases, because the warning is not enough verbosed to indicate us it.

I tried finding negative values in my ID, but i didn't get anything.

thsant commented 4 years ago

@SalahAdDin , I have downloaed your XMLs. The problem is happening for the instances CDY_2015, SVB_1969 and SVB_1971. Numerical problems are creating negative values for x_min (between -1 and 0 range).

Insert in your script something like:

x_min = max(x_min, 0)

before writing the XML.

SalahAdDin commented 4 years ago

@thsant There are other images with negative bounding boxes, why? if it is a numerical problem, does it mean the normalization was wrong? Can we trust in the other converted bounding boxes?

I did this update in order to avoid problems:

                xmin = center_x - (bbox_width / 2)
                ymin = center_y - (bbox_height / 2)
                xmax = center_x + (bbox_width / 2)
                ymax = center_y + (bbox_height / 2)

                ET.SubElement(bbox, 'xmin').text = str(max(xmin,0))
                ET.SubElement(bbox, 'ymin').text = str(max(ymin,0))
                ET.SubElement(bbox, 'xmax').text = str(min(xmax,width))
                ET.SubElement(bbox, 'ymax').text = str(min(ymax,height))
thsant commented 4 years ago

I don't think normalization is wrong - it's a sub-pixel error (values in the interval -1.0 to zero) caused by numerical problems when converting from the YOLO format to the VOC format. Bounding box was performed using tzutalin/labelImg (the tool is able to store YOLO and VOC formats). An alternative is using tzutalin/labelImg to convert from YOLO to VOC, but it is not necessary - a conversion script like yours should do the job. We have successfully used WGISD to train YOLOv2, YOLOv3 and Mask R-CNN. I know other user that has successfully trained YOLO again from scratch using the dataset.

Of course, you can check your XMLs in a viewer and see the annotated grapes.

SalahAdDin commented 4 years ago

@thsant Which Mask R-CNN implementation are you using? How did you train it?

SalahAdDin commented 4 years ago

I just found a ghost box in one image: https://github.com/thsant/wgisd/blob/master/data/SVB_20180427_151848752.txt#L6

andreaceruti commented 3 years ago

@SalahAdDin Hi! I write to you here since in your wgisd forked repo issues are disabilitated. I was wondering if you tried to add in Pascal VOC format also polygon annotations from .npz files.

SalahAdDin commented 3 years ago

@SalahAdDin Hi! I write to you here since in your wgisd forked repo issues are disabilitated. I was wondering if you tried to add in Pascal VOC format also polygon annotations from .npz files.

Well, i don't know how i could do that, sorry.

I will enabled the issues and pull request there then.