Skip to content

Commit d919449

Browse files
committed
draw box with is_rescale aug, update docs for prepro
1 parent f4b4ff0 commit d919449

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tensorlayer/prepro.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ def obj_box_left_right_flip(im, coords=[], is_rescale=False, is_center=False, is
16211621
An image with dimension of [row, col, channel] (default).
16221622
coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...]
16231623
is_rescale : boolean, default False
1624-
Set to True, if the coordinates are rescaled to [0, 1].
1624+
Set to True, if the input coordinates are rescaled to [0, 1].
16251625
is_center : boolean, default False
16261626
Set to True, if the x and y of coordinates are the centroid. (i.e. darknet format)
16271627
is_random : boolean, default False
@@ -1700,7 +1700,7 @@ def obj_box_imresize(im, coords=[], size=[100, 100], interp='bicubic', mode=None
17001700
coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...]
17011701
size, interp, mode : see ``tl.prepro.imresize`` for details.
17021702
is_rescale : boolean, default False
1703-
Set to True, if the coordinates are rescaled to [0, 1], then return the original coordinates.
1703+
Set to True, if the input coordinates are rescaled to [0, 1], then return the original coordinates.
17041704
17051705
Examples
17061706
--------
@@ -1770,7 +1770,7 @@ def obj_box_crop(im, classes=[], coords=[], wrg=100, hrg=100,
17701770
coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...]
17711771
wrg, hrg, is_random : see ``tl.prepro.crop`` for details.
17721772
is_rescale : boolean, default False
1773-
Set to True, if the coordinates are rescaled to [0, 1].
1773+
Set to True, if the input coordinates are rescaled to [0, 1].
17741774
is_center : boolean, default False
17751775
Set to True, if the x and y of coordinates are the centroid. (i.e. darknet format)
17761776
thresh_wh : float
@@ -1897,7 +1897,7 @@ def obj_box_shift(im, classes=[], coords=[], wrg=0.1, hrg=0.1,
18971897
coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...]
18981898
wrg, hrg, row_index, col_index, channel_index, is_random, fill_mode, cval, order : see ``tl.prepro.shift``.
18991899
is_rescale : boolean, default False
1900-
Set to True, if the coordinates are rescaled to [0, 1].
1900+
Set to True, if the input coordinates are rescaled to [0, 1].
19011901
is_center : boolean, default False
19021902
Set to True, if the x and y of coordinates are the centroid. (i.e. darknet format)
19031903
thresh_wh : float
@@ -2007,7 +2007,7 @@ def obj_box_zoom(im, classes=[], coords=[], zoom_range=(0.9, 1.1),
20072007
coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...]
20082008
zoom_range, row_index, col_index, channel_index, is_random, fill_mode, cval, order : see ``tl.prepro.zoom``.
20092009
is_rescale : boolean, default False
2010-
Set to True, if the coordinates are rescaled to [0, 1].
2010+
Set to True, if the input coordinates are rescaled to [0, 1].
20112011
is_center : boolean, default False
20122012
Set to True, if the x and y of coordinates are the centroid. (i.e. darknet format)
20132013
thresh_wh : float

tensorlayer/visualize.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ 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-
box_centroid_to_upleft_butright=True, save_name=None):
93+
box_centroid_to_upleft_butright=True, is_rescale=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
9797
-----------
9898
image : RGB image in numpy.array, [height, width, channel].
99-
classes : list of class ID (int).
100-
coords : list of list for coordinates.
101-
- [x, y, x2, y2] (up-left and botton-right)
102-
- or [x_center, y_center, w, h] (set box_centroid_to_upleft_butright to True).
103-
scores : list of score (int). (Optional)
104-
classes_list : list of string, for converting ID to string.
99+
classes : a list of class ID (int).
100+
coords : a list of list for coordinates.
101+
- Should be [x, y, x2, y2] (up-left and botton-right format)
102+
- If [x_center, y_center, w, h] (set box_centroid_to_upleft_butright to True).
103+
scores : a list of score (float). (Optional)
104+
classes_list : list of string, for converting ID to string on image.
105105
box_centroid_to_upleft_butright : boolean, defalt is True.
106106
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).
107107
If coords is [x1, x2, y1, y2], set it to False.

0 commit comments

Comments
 (0)