Upload handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -16,7 +16,7 @@ class EndpointHandler():
|
|
| 16 |
path = inputs.get("path")
|
| 17 |
key = inputs.get("key")
|
| 18 |
########################### Load Image #################################
|
| 19 |
-
|
| 20 |
api_url="https://detect.roboflow.com",
|
| 21 |
api_key=key
|
| 22 |
)
|
|
@@ -35,7 +35,7 @@ class EndpointHandler():
|
|
| 35 |
# clothing-segmentation-dataset/1
|
| 36 |
# t-shirts-detector/1
|
| 37 |
# mainmodel/2
|
| 38 |
-
result =
|
| 39 |
detections = sv.Detections.from_inference(result)
|
| 40 |
# print(detections)
|
| 41 |
###########################################################################
|
|
|
|
| 16 |
path = inputs.get("path")
|
| 17 |
key = inputs.get("key")
|
| 18 |
########################### Load Image #################################
|
| 19 |
+
CLIENT = InferenceHTTPClient(
|
| 20 |
api_url="https://detect.roboflow.com",
|
| 21 |
api_key=key
|
| 22 |
)
|
|
|
|
| 35 |
# clothing-segmentation-dataset/1
|
| 36 |
# t-shirts-detector/1
|
| 37 |
# mainmodel/2
|
| 38 |
+
result = CLIENT.infer(path, model_id="mainmodel/2")
|
| 39 |
detections = sv.Detections.from_inference(result)
|
| 40 |
# print(detections)
|
| 41 |
###########################################################################
|