Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ object_detector = pipeline("object-detection",
|
|
15 |
# model=model_path)
|
16 |
|
17 |
|
18 |
-
def draw_bounding_boxes(image, detections, font_path=None, font_size=
|
19 |
# Make a copy of the image to draw on
|
20 |
draw_image = image.copy()
|
21 |
draw = ImageDraw.Draw(draw_image)
|
@@ -36,7 +36,7 @@ def draw_bounding_boxes(image, detections, font_path=None, font_size=300):
|
|
36 |
ymax = box['ymax']
|
37 |
|
38 |
# Draw the bounding box
|
39 |
-
draw.rectangle([(xmin, ymin), (xmax, ymax)], outline="red", width=
|
40 |
|
41 |
# Optionally, you can also draw the label and score
|
42 |
label = detection['label']
|
|
|
15 |
# model=model_path)
|
16 |
|
17 |
|
18 |
+
def draw_bounding_boxes(image, detections, font_path=None, font_size=50):
|
19 |
# Make a copy of the image to draw on
|
20 |
draw_image = image.copy()
|
21 |
draw = ImageDraw.Draw(draw_image)
|
|
|
36 |
ymax = box['ymax']
|
37 |
|
38 |
# Draw the bounding box
|
39 |
+
draw.rectangle([(xmin, ymin), (xmax, ymax)], outline="red", width=8)
|
40 |
|
41 |
# Optionally, you can also draw the label and score
|
42 |
label = detection['label']
|