atalaydenknalbant commited on
Commit
631cb4f
·
verified ·
1 Parent(s): ad343a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -16,7 +16,10 @@ def yolo_inference(input_type, image, video, model_id, conf_threshold, iou_thres
16
  Accepts detect/seg/pose/obb/cls checkpoints and renders r.plot().
17
  """
18
  model = YOLO(model_id)
19
- del model.model.model[-1].one2one_cv2
 
 
 
20
  if input_type == "Image":
21
  if image is None:
22
  w, h = 640, 480
 
16
  Accepts detect/seg/pose/obb/cls checkpoints and renders r.plot().
17
  """
18
  model = YOLO(model_id)
19
+ if getattr(model, "task", None) != "classify":
20
+ head = model.model.model[-1]
21
+ if hasattr(head, "one2one_cv2"):
22
+ delattr(head, "one2one_cv2")
23
  if input_type == "Image":
24
  if image is None:
25
  w, h = 640, 480