Update handler.py
Browse files- handler.py +2 -4
handler.py
CHANGED
|
@@ -7,8 +7,8 @@ import logging
|
|
| 7 |
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
-
self.processor = AutoProcessor.from_pretrained("Blueway/inference-endpoint-
|
| 11 |
-
self.model = OmDetTurboForObjectDetection.from_pretrained("Blueway/inference-endpoint-
|
| 12 |
|
| 13 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 14 |
"""
|
|
@@ -33,8 +33,6 @@ class EndpointHandler():
|
|
| 33 |
score_threshold=0.3,
|
| 34 |
nms_threshold=0.3,
|
| 35 |
)[0]
|
| 36 |
-
print(results)
|
| 37 |
-
logging.error(results)
|
| 38 |
# Convert tensors to lists
|
| 39 |
serializable_results = {
|
| 40 |
'boxes': results['boxes'].tolist(),
|
|
|
|
| 7 |
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
+
self.processor = AutoProcessor.from_pretrained("Blueway/inference-endpoint-for-omdet-turbo-swin-tiny-hf")
|
| 11 |
+
self.model = OmDetTurboForObjectDetection.from_pretrained("Blueway/inference-endpoint-for-omdet-turbo-swin-tiny-hf")
|
| 12 |
|
| 13 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 14 |
"""
|
|
|
|
| 33 |
score_threshold=0.3,
|
| 34 |
nms_threshold=0.3,
|
| 35 |
)[0]
|
|
|
|
|
|
|
| 36 |
# Convert tensors to lists
|
| 37 |
serializable_results = {
|
| 38 |
'boxes': results['boxes'].tolist(),
|