forked from huawei/mindspore2022
!2853 BBox Ops Python Test file - Fix_Annotate function bug fix
Merge pull request !2853 from danishnxt/AugOps-fix
This commit is contained in:
commit
7cc4b8438e
|
|
@ -34,12 +34,16 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for bbox in bboxes:
|
for bbox in bboxes:
|
||||||
tmp = bbox[0]
|
if bbox.size == 7:
|
||||||
bbox[0] = bbox[1]
|
tmp = bbox[0]
|
||||||
bbox[1] = bbox[2]
|
bbox[0] = bbox[1]
|
||||||
bbox[2] = bbox[3]
|
bbox[1] = bbox[2]
|
||||||
bbox[3] = bbox[4]
|
bbox[2] = bbox[3]
|
||||||
bbox[4] = tmp
|
bbox[3] = bbox[4]
|
||||||
|
bbox[4] = tmp
|
||||||
|
else:
|
||||||
|
print("ERROR: Invalid Bounding Box size provided")
|
||||||
|
break
|
||||||
return bboxes
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,16 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for bbox in bboxes:
|
for bbox in bboxes:
|
||||||
tmp = bbox[0]
|
if bbox.size == 7:
|
||||||
bbox[0] = bbox[1]
|
tmp = bbox[0]
|
||||||
bbox[1] = bbox[2]
|
bbox[0] = bbox[1]
|
||||||
bbox[2] = bbox[3]
|
bbox[1] = bbox[2]
|
||||||
bbox[3] = bbox[4]
|
bbox[2] = bbox[3]
|
||||||
bbox[4] = tmp
|
bbox[3] = bbox[4]
|
||||||
|
bbox[4] = tmp
|
||||||
|
else:
|
||||||
|
print("ERROR: Invalid Bounding Box size provided")
|
||||||
|
break
|
||||||
return bboxes
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,16 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for bbox in bboxes:
|
for bbox in bboxes:
|
||||||
tmp = bbox[0]
|
if bbox.size == 7:
|
||||||
bbox[0] = bbox[1]
|
tmp = bbox[0]
|
||||||
bbox[1] = bbox[2]
|
bbox[0] = bbox[1]
|
||||||
bbox[2] = bbox[3]
|
bbox[1] = bbox[2]
|
||||||
bbox[3] = bbox[4]
|
bbox[2] = bbox[3]
|
||||||
bbox[4] = tmp
|
bbox[3] = bbox[4]
|
||||||
|
bbox[4] = tmp
|
||||||
|
else:
|
||||||
|
print("ERROR: Invalid Bounding Box size provided")
|
||||||
|
break
|
||||||
return bboxes
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,16 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for bbox in bboxes:
|
for bbox in bboxes:
|
||||||
tmp = bbox[0]
|
if bbox.size == 7:
|
||||||
bbox[0] = bbox[1]
|
tmp = bbox[0]
|
||||||
bbox[1] = bbox[2]
|
bbox[0] = bbox[1]
|
||||||
bbox[2] = bbox[3]
|
bbox[1] = bbox[2]
|
||||||
bbox[3] = bbox[4]
|
bbox[2] = bbox[3]
|
||||||
bbox[4] = tmp
|
bbox[3] = bbox[4]
|
||||||
|
bbox[4] = tmp
|
||||||
|
else:
|
||||||
|
print("ERROR: Invalid Bounding Box size provided")
|
||||||
|
break
|
||||||
return bboxes
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,11 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for (i, box) in enumerate(bboxes):
|
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
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,16 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for bbox in bboxes:
|
for bbox in bboxes:
|
||||||
tmp = bbox[0]
|
if bbox.size == 7:
|
||||||
bbox[0] = bbox[1]
|
tmp = bbox[0]
|
||||||
bbox[1] = bbox[2]
|
bbox[0] = bbox[1]
|
||||||
bbox[2] = bbox[3]
|
bbox[1] = bbox[2]
|
||||||
bbox[3] = bbox[4]
|
bbox[2] = bbox[3]
|
||||||
bbox[4] = tmp
|
bbox[3] = bbox[4]
|
||||||
|
bbox[4] = tmp
|
||||||
|
else:
|
||||||
|
print("ERROR: Invalid Bounding Box size provided")
|
||||||
|
break
|
||||||
return bboxes
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,11 @@ def fix_annotate(bboxes):
|
||||||
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
:return: annotation in [x_min, y_min, w, h, label, truncate, difficult] format
|
||||||
"""
|
"""
|
||||||
for (i, box) in enumerate(bboxes):
|
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
|
return bboxes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue