kadirnar commited on
Commit
a8a7793
·
verified ·
1 Parent(s): 5426eb9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -28,10 +28,11 @@ def yolov9_inference(img_path, model_path,image_size, conf_threshold, iou_thresh
28
 
29
  # Optionally, show detection bounding boxes on image
30
  save_path = 'output/'
31
- results.save(labels=True, save_dir=save_path)
32
 
33
-
34
- return save_path + img_path
 
35
 
36
 
37
  inputs = [
@@ -44,9 +45,9 @@ inputs = [
44
  "yolov9-c.pt",
45
  "yolov9-e.pt",
46
  ],
47
- value="gelan-e.pt",
48
  ),
49
- gr.Slider(minimum=320, maximum=1280, value=1280, step=32, label="Image Size"),
50
  gr.Slider(minimum=0.0, maximum=1.0, value=0.25, step=0.05, label="Confidence Threshold"),
51
  gr.Slider(minimum=0.0, maximum=1.0, value=0.45, step=0.05, label="IOU Threshold"),
52
  ]
 
28
 
29
  # Optionally, show detection bounding boxes on image
30
  save_path = 'output/'
31
+ results.save(labels=True, save_dir=save_path, exist_ok=True)
32
 
33
+ output_path = save_path + img_path
34
+ print(f"Output image saved to {output_path}")
35
+ return output_path
36
 
37
 
38
  inputs = [
 
45
  "yolov9-c.pt",
46
  "yolov9-e.pt",
47
  ],
48
+ value="gelan-c.pt",
49
  ),
50
+ gr.Slider(minimum=320, maximum=1280, value=640, step=32, label="Image Size"),
51
  gr.Slider(minimum=0.0, maximum=1.0, value=0.25, step=0.05, label="Confidence Threshold"),
52
  gr.Slider(minimum=0.0, maximum=1.0, value=0.45, step=0.05, label="IOU Threshold"),
53
  ]