Update handler.py
Browse files17 unmodified lines181920212223248 unmodified lines333435363738392 unmodified lines4243444546474817 unmodified lines key = inputs.get("key") ########################### Load Image ################################# CLIENT = InferenceHTTPClient(api_url="https://detect.roboflow.com", api_key=key) print("get client") if isurl: # for url set isurl = 1 req = urllib.request.urlopen(path) arr = np.asarray(bytearray(req.read()), dtype=np.uint8)8 unmodified lines # clothing-segmentation-dataset/1 # t-shirts-detector/1 # mainmodel/2 print("start model detection") result = CLIENT.infer(path, model_id="mainmodel/2") detections = sv.Detections.from_inference(result) # print(detections)2 unmodified lines ########################### Data proccessing ################################# # only pass the first detection # change 1 -> to len(detections.xyxy) to pass all photos print("Data processing") if detections.confidence.size == 0: return "Not Found" else:handler.py+3