@@ -31,15 +31,15 @@ a specific image, as well as the size of the image as a `(width, height)` tuple.
31
31
It also contains a set of methods that allow to perform geometric
32
32
transformations to the bounding boxes (such as cropping, scaling and flipping).
33
33
The class accepts bounding boxes from two different input formats:
34
- - ` xyxy ` , where each box is encoded as a ` x1 ` , ` y1 ` , ` x2 ` and ` y2 ` coordinates)
34
+ - ` xyxy ` , where each box is encoded as a ` x1 ` , ` y1 ` , ` x2 ` and ` y2 ` coordinates, and
35
35
- ` xywh ` , where each box is encoded as ` x1 ` , ` y1 ` , ` w ` and ` h ` .
36
36
37
37
Additionally, each ` BoxList ` instance can also hold arbitrary additional information
38
38
for each bounding box, such as labels, visibility, probability scores etc.
39
39
40
40
Here is an example on how to create a ` BoxList ` from a list of coordinates:
41
41
``` python
42
- from maskrcnn_baseline .structures.bounding_box import BoxList, FLIP_LEFT_RIGHT
42
+ from maskrcnn_benchmark .structures.bounding_box import BoxList, FLIP_LEFT_RIGHT
43
43
44
44
width = 100
45
45
height = 200
@@ -49,7 +49,7 @@ boxes = [
49
49
[10 , 10 , 50 , 50 ]
50
50
]
51
51
# create a BoxList with 3 boxes
52
- bbox = BoxList(boxes, size = (width, height), mode = ' xyxy' )
52
+ bbox = BoxList(boxes, image_size = (width, height), mode = ' xyxy' )
53
53
54
54
# perform some box transformations, has similar API as PIL.Image
55
55
bbox_scaled = bbox.resize((width * 2 , height * 3 ))
0 commit comments