atalaydenknalbant commited on
Commit
b8eded5
·
verified ·
1 Parent(s): 5236243

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -15,6 +15,8 @@ def get_model_path(model_name):
15
 
16
  @spaces.GPU
17
  def yolo_inference(images, model_id, conf_threshold, iou_threshold, max_detection):
 
 
18
  model_path = get_model_path(model_id) # Download model
19
  model_type = RTDETR if 'rtdetr' in model_id.lower() else YOLO
20
  model = model_type(model_path)
 
15
 
16
  @spaces.GPU
17
  def yolo_inference(images, model_id, conf_threshold, iou_threshold, max_detection):
18
+ if images is None:
19
+ return None
20
  model_path = get_model_path(model_id) # Download model
21
  model_type = RTDETR if 'rtdetr' in model_id.lower() else YOLO
22
  model = model_type(model_path)