import cv2 import gradio as gr from ultralytics import YOLO def inference(path:str, threshold:float=0.6): print("trying inference with path", path) if path is None: return None,0 model = YOLO('yolov8m.pt') model.classes = [0] # only considering class 'person' and not the 79 other classes... image = cv2.imread(path) outputs = model.predict(source=path, return_outputs=True) for output in outputs: # mono item batch detections = output['det'] counter=0 for detection in detections: if detection[4]