till-onethousand commited on
Commit
02d3d6b
·
1 Parent(s): 7e557a8
Files changed (2) hide show
  1. app.py +2 -1
  2. run.py +2 -2
app.py CHANGED
@@ -10,7 +10,8 @@ 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.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
 
 
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'/home/user/app/model/darknet detect /home/user/app/model/cfg/yolov2.cfg /home/user/app/model/yolov2.weights /home/user/app/model/data/dog.jpg')
15
 
16
  return '/home/user/app/model/predictions.jpg'
17
 
run.py CHANGED
@@ -1,3 +1,3 @@
1
  import os
2
- os.chdir('./model')
3
- os.system('./darknet detect cfg/yolov2.cfg yolov2.weights data/dog.jpg')
 
1
  import os
2
+ os.chdir('/Users/tillwenke/Documents/darknet')
3
+ os.system(f'/Users/tillwenke/Documents/darknet/darknet detect /Users/tillwenke/Documents/darknet/cfg/yolov2.cfg /Users/tillwenke/Documents/darknet/yolov2.weights /Users/tillwenke/Documents/darknet/data/dog.jpg')