sayedM commited on
Commit
d0e52d5
·
1 Parent(s): d6d3399

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -36,10 +36,11 @@ def yolov8_inference(
36
 
37
  image=image[:, :, ::-1].astype(np.uint8)
38
  model = YOLO("https://huggingface.co/spaces/devisionx/Fourth_demo/blob/main/best.pt")
39
- results = model(image,imgsz=640)[0]
40
  image=image[:, :, ::-1].astype(np.uint8)
41
  detections = sv.Detections.from_yolov8(results)
42
- annotated_image = annotatorbbox.annotate(scene=image, detections=detections)
 
43
 
44
 
45
 
@@ -61,7 +62,7 @@ title = "Wheel Segmentation Demo"
61
  '''
62
  import os
63
  examples = [
64
- ["wh1.jpg", 0.6, 0.45],
65
  ["wh2.jpg", 0.25, 0.45],
66
  ["wh3.jpg", 0.25, 0.45],
67
  ]
 
36
 
37
  image=image[:, :, ::-1].astype(np.uint8)
38
  model = YOLO("https://huggingface.co/spaces/devisionx/Fourth_demo/blob/main/best.pt")
39
+ results = model(image,imgsz=640,conf=conf_threshold,iou=iou_threshold)[0]
40
  image=image[:, :, ::-1].astype(np.uint8)
41
  detections = sv.Detections.from_yolov8(results)
42
+ annotated_image = annotatormask.annotate(scene=image, detections=detections)
43
+ annotated_image = annotatorbbox.annotate(scene=annotated_image , detections=detections)
44
 
45
 
46
 
 
62
  '''
63
  import os
64
  examples = [
65
+ ["wh1.jpg", 0.25, 0.45],
66
  ["wh2.jpg", 0.25, 0.45],
67
  ["wh3.jpg", 0.25, 0.45],
68
  ]