Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,10 @@ def yolov8_inference(
|
|
| 37 |
|
| 38 |
image=image[:, :, ::-1].astype(np.uint8)
|
| 39 |
model = YOLO("https://huggingface.co/spaces/devisionx/Fifth_demo/blob/main/best_weigh.pt")
|
| 40 |
-
results = model(image,imgsz=360)[0]
|
| 41 |
image=image[:, :, ::-1].astype(np.uint8)
|
| 42 |
detections = sv.Detections.from_yolov8(results)
|
| 43 |
-
annotated_image =
|
| 44 |
annotated_image = annotatorbbox.annotate(scene=annotated_image , detections=detections)
|
| 45 |
|
| 46 |
|
|
|
|
| 37 |
|
| 38 |
image=image[:, :, ::-1].astype(np.uint8)
|
| 39 |
model = YOLO("https://huggingface.co/spaces/devisionx/Fifth_demo/blob/main/best_weigh.pt")
|
| 40 |
+
results = model(image,imgsz=360,conf=conf_threshold,iou=iou_threshold)[0]
|
| 41 |
image=image[:, :, ::-1].astype(np.uint8)
|
| 42 |
detections = sv.Detections.from_yolov8(results)
|
| 43 |
+
annotated_image = annotatormask.annotate(scene=image, detections=detections)
|
| 44 |
annotated_image = annotatorbbox.annotate(scene=annotated_image , detections=detections)
|
| 45 |
|
| 46 |
|