Spaces:
Runtime error
Runtime error
Commit
·
2a0ffec
1
Parent(s):
410e142
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ annotatormask=sv.MaskAnnotator()
|
|
29 |
def yolov8_inference(
|
30 |
image: gr.inputs.Image = None,
|
31 |
model_name: gr.inputs.Dropdown = None,
|
32 |
-
image_size: gr.inputs.Slider =
|
33 |
conf_threshold: gr.inputs.Slider = 0.25,
|
34 |
iou_threshold: gr.inputs.Slider = 0.45,
|
35 |
):
|
@@ -37,7 +37,7 @@ def yolov8_inference(
|
|
37 |
|
38 |
model = YOLO("https://huggingface.co/spaces/devisionx/Fifth_model/blob/main/best_weigh.pt")
|
39 |
|
40 |
-
results = model(image,conf=conf_threshold,iou=iou_threshold ,imgsz=
|
41 |
detections = sv.Detections.from_yolov8(results)
|
42 |
annotated_image = annotatorbbox.annotate(scene=image, detections=detections)
|
43 |
annotated_image = annotatormask.annotate(scene=annotated_image, detections=detections)
|
|
|
29 |
def yolov8_inference(
|
30 |
image: gr.inputs.Image = None,
|
31 |
model_name: gr.inputs.Dropdown = None,
|
32 |
+
image_size: gr.inputs.Slider = 360,
|
33 |
conf_threshold: gr.inputs.Slider = 0.25,
|
34 |
iou_threshold: gr.inputs.Slider = 0.45,
|
35 |
):
|
|
|
37 |
|
38 |
model = YOLO("https://huggingface.co/spaces/devisionx/Fifth_model/blob/main/best_weigh.pt")
|
39 |
|
40 |
+
results = model(image,conf=conf_threshold,iou=iou_threshold ,imgsz=360)[0]
|
41 |
detections = sv.Detections.from_yolov8(results)
|
42 |
annotated_image = annotatorbbox.annotate(scene=image, detections=detections)
|
43 |
annotated_image = annotatormask.annotate(scene=annotated_image, detections=detections)
|