Browse Source

fix_annotate bug fix

tags/v0.6.0-beta
Danish Farid 6 years ago
parent
commit
5a9673ee6f
7 changed files with 60 additions and 32 deletions
  1. +10
    -6
      tests/ut/python/dataset/test_bounding_box_augment.py
  2. +10
    -6
      tests/ut/python/dataset/test_random_crop_and_resize_with_bbox.py
  3. +10
    -6
      tests/ut/python/dataset/test_random_crop_with_bbox.py
  4. +10
    -6
      tests/ut/python/dataset/test_random_horizontal_flip_with_bbox.py
  5. +5
    -1
      tests/ut/python/dataset/test_random_resize_with_bbox.py
  6. +10
    -6
      tests/ut/python/dataset/test_random_vertical_flip_with_bbox.py
  7. +5
    -1
      tests/ut/python/dataset/test_resize_with_bbox.py

+ 10
- 6
tests/ut/python/dataset/test_bounding_box_augment.py View File

@@ -34,12 +34,16 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for bbox in bboxes:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
if bbox.size == 7:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 10
- 6
tests/ut/python/dataset/test_random_crop_and_resize_with_bbox.py View File

@@ -36,12 +36,16 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for bbox in bboxes:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
if bbox.size == 7:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 10
- 6
tests/ut/python/dataset/test_random_crop_with_bbox.py View File

@@ -37,12 +37,16 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for bbox in bboxes:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
if bbox.size == 7:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 10
- 6
tests/ut/python/dataset/test_random_horizontal_flip_with_bbox.py View File

@@ -34,12 +34,16 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for bbox in bboxes:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
if bbox.size == 7:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 5
- 1
tests/ut/python/dataset/test_random_resize_with_bbox.py View File

@@ -35,7 +35,11 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for (i, box) in enumerate(bboxes):
bboxes[i] = np.roll(box, -1)
if box.size == 7:
bboxes[i] = np.roll(box, -1)
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 10
- 6
tests/ut/python/dataset/test_random_vertical_flip_with_bbox.py View File

@@ -36,12 +36,16 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for bbox in bboxes:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
if bbox.size == 7:
tmp = bbox[0]
bbox[0] = bbox[1]
bbox[1] = bbox[2]
bbox[2] = bbox[3]
bbox[3] = bbox[4]
bbox[4] = tmp
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




+ 5
- 1
tests/ut/python/dataset/test_resize_with_bbox.py View File

@@ -35,7 +35,11 @@ def fix_annotate(bboxes):
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
"""
for (i, box) in enumerate(bboxes):
bboxes[i] = np.roll(box, -1)
if box.size == 7:
bboxes[i] = np.roll(box, -1)
else:
print("ERROR: Invalid Bounding Box size provided")
break
return bboxes




Loading…
Cancel
Save