Spaces:
Runtime error
Runtime error
update plotting code, fix data conversion bug
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ def plot_bounding_boxes(image, boxes, box_type):
|
|
| 8 |
if not boxes:
|
| 9 |
return image
|
| 10 |
|
| 11 |
-
x0, y0, x1, y1 = [int(i.
|
| 12 |
|
| 13 |
if box_type == "xywh":
|
| 14 |
x0 = x0 * image.size[0]
|
|
@@ -24,7 +24,7 @@ def plot_bounding_boxes(image, boxes, box_type):
|
|
| 24 |
|
| 25 |
image = np.array(image)
|
| 26 |
|
| 27 |
-
bounding_box_annotator = sv.BoundingBoxAnnotator()
|
| 28 |
annotated_image = bounding_box_annotator.annotate(
|
| 29 |
scene=image, detections=detections
|
| 30 |
)
|
|
|
|
| 8 |
if not boxes:
|
| 9 |
return image
|
| 10 |
|
| 11 |
+
x0, y0, x1, y1 = [int(float(i.split(".")[0])) for i in boxes.split(",")]
|
| 12 |
|
| 13 |
if box_type == "xywh":
|
| 14 |
x0 = x0 * image.size[0]
|
|
|
|
| 24 |
|
| 25 |
image = np.array(image)
|
| 26 |
|
| 27 |
+
bounding_box_annotator = sv.BoundingBoxAnnotator(thickness=3)
|
| 28 |
annotated_image = bounding_box_annotator.annotate(
|
| 29 |
scene=image, detections=detections
|
| 30 |
)
|