kadirnar commited on
Commit
658205c
·
verified ·
1 Parent(s): 2a21ba1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -44,12 +44,13 @@ def attempt_download_from_hub(repo_id, hf_token=None):
44
  except (RepositoryNotFoundError, HFValidationError):
45
  return None
46
 
 
 
 
47
 
48
  @spaces.GPU(duration=10)
49
  def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold):
50
- MODEL_PATH = attempt_download_from_hub(model_id)
51
- model = model = YOLO(MODEL_PATH)
52
- model.to('cuda')
53
  results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
54
  detections = sv.Detections.from_ultralytics(results)
55
 
 
44
  except (RepositoryNotFoundError, HFValidationError):
45
  return None
46
 
47
+ MODEL_PATH = attempt_download_from_hub(model_id)
48
+ model = model = YOLO(MODEL_PATH)
49
+ model.to('cuda')
50
 
51
  @spaces.GPU(duration=10)
52
  def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold):
53
+
 
 
54
  results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
55
  detections = sv.Detections.from_ultralytics(results)
56