Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -127,7 +127,7 @@ def annotate_image(image: Image.Image, result: dict):
|
|
| 127 |
|
| 128 |
points_array = np.array(points_list).reshape(1, -1, 2)
|
| 129 |
key_points = sv.KeyPoints(xy=points_array)
|
| 130 |
-
vertex_annotator = sv.VertexAnnotator(radius=
|
| 131 |
return vertex_annotator.annotate(scene=image.copy(), key_points=key_points)
|
| 132 |
|
| 133 |
if "objects" in result and result["objects"]:
|
|
@@ -147,7 +147,7 @@ def annotate_image(image: Image.Image, result: dict):
|
|
| 147 |
if len(detections) == 0:
|
| 148 |
return image
|
| 149 |
|
| 150 |
-
box_annotator = sv.BoxAnnotator(color_lookup=sv.ColorLookup.INDEX, thickness=
|
| 151 |
return box_annotator.annotate(scene=image.copy(), detections=detections)
|
| 152 |
|
| 153 |
return image
|
|
|
|
| 127 |
|
| 128 |
points_array = np.array(points_list).reshape(1, -1, 2)
|
| 129 |
key_points = sv.KeyPoints(xy=points_array)
|
| 130 |
+
vertex_annotator = sv.VertexAnnotator(radius=4, color=sv.Color.RED)
|
| 131 |
return vertex_annotator.annotate(scene=image.copy(), key_points=key_points)
|
| 132 |
|
| 133 |
if "objects" in result and result["objects"]:
|
|
|
|
| 147 |
if len(detections) == 0:
|
| 148 |
return image
|
| 149 |
|
| 150 |
+
box_annotator = sv.BoxAnnotator(color_lookup=sv.ColorLookup.INDEX, thickness=2)
|
| 151 |
return box_annotator.annotate(scene=image.copy(), detections=detections)
|
| 152 |
|
| 153 |
return image
|