Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def inference(image_path, model_name, bbox_threshold):
|
|
| 62 |
tensor_img, _ = transforms(image, None)
|
| 63 |
tensor_img = tensor_img.unsqueeze(0)
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
if model_name == "RF-DETR-B":
|
| 68 |
model_path = "rfdetr.onnx"
|
|
@@ -77,8 +77,8 @@ def inference(image_path, model_name, bbox_threshold):
|
|
| 77 |
providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
|
| 78 |
sess_options=sess_options
|
| 79 |
)
|
| 80 |
-
|
| 81 |
-
ort_inputs = {ort_session.get_inputs()[0].name:
|
| 82 |
ort_outs = ort_session.run(None, ort_inputs)
|
| 83 |
|
| 84 |
boxes, labels, scores = ort_outs
|
|
|
|
| 62 |
tensor_img, _ = transforms(image, None)
|
| 63 |
tensor_img = tensor_img.unsqueeze(0)
|
| 64 |
|
| 65 |
+
|
| 66 |
|
| 67 |
if model_name == "RF-DETR-B":
|
| 68 |
model_path = "rfdetr.onnx"
|
|
|
|
| 77 |
providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
|
| 78 |
sess_options=sess_options
|
| 79 |
)
|
| 80 |
+
|
| 81 |
+
ort_inputs = {ort_session.get_inputs()[0].name: tensor_img.cpu().numpy()}
|
| 82 |
ort_outs = ort_session.run(None, ort_inputs)
|
| 83 |
|
| 84 |
boxes, labels, scores = ort_outs
|