Skip to content

Commit e363cdc

Browse files
committed
rename aug in draw obj box
1 parent aec2536 commit e363cdc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tensorlayer/visualize.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def imsave(images, size, path):
9090
# for object detection
9191
def draw_boxes_and_labels_to_image(image, classes=[], coords=[],
9292
scores=[], classes_list=[],
93-
bbox_center_to_rectangle=True, save_name=None):
93+
box_centroid_to_upleft_butright=True, save_name=None):
9494
""" Draw bboxes and class labels on image. Return or save the image with bboxes, example in the docs of ``tl.prepro``.
9595
9696
Parameters
@@ -99,11 +99,12 @@ def draw_boxes_and_labels_to_image(image, classes=[], coords=[],
9999
classes : list of class ID (int).
100100
coords : list of list for coordinates.
101101
- [x, y, x2, y2] (up-left and botton-right)
102-
- or [x_center, y_center, w, h] (set bbox_center_to_rectangle to True).
102+
- or [x_center, y_center, w, h] (set box_centroid_to_upleft_butright to True).
103103
scores : list of score (int). (Optional)
104104
classes_list : list of string, for converting ID to string.
105-
bbox_center_to_rectangle : boolean, defalt is True.
106-
If True, convert [x_center, y_center, w, h] to [x, y, x2, y2] (up-left and botton-right).
105+
box_centroid_to_upleft_butright : boolean, defalt is True.
106+
If coords is [x_center, y_center, w, h], set it to True for converting [x_center, y_center, w, h] to [x, y, x2, y2] (up-left and botton-right).
107+
If coords is [x1, x2, y1, y2], set it to False.
107108
is_rescale : boolean, defalt is True.
108109
If True, the input coordinates are the portion of width and high, this API will scale the coordinates to pixel unit internally.
109110
If False, feed the coordinates with pixel unit format.
@@ -128,7 +129,7 @@ def draw_boxes_and_labels_to_image(image, classes=[], coords=[],
128129
thick = int((imh + imw) // 430)
129130

130131
for i in range(len(coords)):
131-
if bbox_center_to_rectangle:
132+
if box_centroid_to_upleft_butright:
132133
x, y, x2, y2 = prepro.obj_box_coord_centroid_to_upleft_butright(coords[i])
133134
else:
134135
x, y, x2, y2 = coords[i]

0 commit comments

Comments
 (0)