Update handler.py
Browse files18 unmodified lines1920212223242526275 unmodified lines3334353637383917 unmodified lines5758596061626318 unmodified lines# print("Current working directory:", current_directory)url = "https://drive.google.com/file/d/1jB8sDYYOTfuF7B1PMcDjkm5R7huv97Wm"gdown.download(url, './best.pt', quiet=False)self.model = YOLO("./best.pt")def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:inputs = data.get("inputs")print("in call")5 unmodified linesprint("is path")print(path)# path = "http://10.10.2.100/cam-lo.jpg"########################### Load Image #################################if(isurl): # for url set isurl = 1print("checkpoint 2-1")17 unmodified lines# t-shirts-detector/1# mainmodel/2#result = self.CLIENT.infer(path, model_id="mainmodel/2")result = self.model(img)#annotated_frame = result[0].plot()detections = result[0].boxes#print(result[0].boxes.xyxy)18 unmodified lines1920212223242526275 unmodified lines3334353637383917 unmodified lines5758596061626318 unmodified lines# print("Current working directory:", current_directory)url = "https://drive.google.com/file/d/1jB8sDYYOTfuF7B1PMcDjkm5R7huv97Wm"gdown.download(url, 'best.pt', quiet=False)self.model = YOLO("best.pt")def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:inputs = data.get("inputs")print("in call")5 unmodified linesprint("is path")print(path)# path = "http://10.10.2.100/cam-lo.jpg"model = self.model########################### Load Image #################################if(isurl): # for url set isurl = 1print("checkpoint 2-1")17 unmodified lines# t-shirts-detector/1# mainmodel/2#result = self.CLIENT.infer(path, model_id="mainmodel/2")result = model(img)#annotated_frame = result[0].plot()detections = result[0].boxes#print(result[0].boxes.xyxy)
handler.py+4-4