till-onethousand commited on
Commit
4f0c2e0
·
1 Parent(s): b4217c9
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -10,8 +10,7 @@ model = None
10
 
11
  def predict_image(img, conf_threshold, iou_threshold, model_name):
12
  """Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
13
- os.chdir('/home/user/app/model')
14
- os.system(f'./darknet detect cfg/yolov2.cfg yolov2.weights data/dog.jpg')
15
 
16
  return '/home/user/app/model/predictions.jpg'
17
 
@@ -29,4 +28,4 @@ iface = gr.Interface(
29
  description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
30
  )
31
 
32
- iface.launch(share=True)
 
10
 
11
  def predict_image(img, conf_threshold, iou_threshold, model_name):
12
  """Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
13
+ os.system(f'/home/user/app/model/darknet detect /home/user/app/modelcfg/yolov2.cfg /home/user/app/modelyolov2.weights /home/user/app/modeldata/dog.jpg')
 
14
 
15
  return '/home/user/app/model/predictions.jpg'
16
 
 
28
  description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
29
  )
30
 
31
+ iface.launch()