Spaces:
Running
Running
Update model_yolov5.py
Browse files- model_yolov5.py +2 -2
model_yolov5.py
CHANGED
|
@@ -12,11 +12,11 @@ def load_model(model_path, img_size=640):
|
|
| 12 |
return model
|
| 13 |
|
| 14 |
|
| 15 |
-
|
| 16 |
def inference(model, image):
|
| 17 |
"""Run inference on image and return annotated image."""
|
| 18 |
results = model(image, size=model.img_size)
|
| 19 |
-
print(results)
|
| 20 |
annotator = Annotator(np.asarray(image))
|
| 21 |
for *box, _, cls in reversed(results.pred[0]):
|
| 22 |
# label = f'{model.names[int(cls)]} {conf:.2f}'
|
|
|
|
| 12 |
return model
|
| 13 |
|
| 14 |
|
| 15 |
+
@spaces.GPU
|
| 16 |
def inference(model, image):
|
| 17 |
"""Run inference on image and return annotated image."""
|
| 18 |
results = model(image, size=model.img_size)
|
| 19 |
+
print(f"{results=}")
|
| 20 |
annotator = Annotator(np.asarray(image))
|
| 21 |
for *box, _, cls in reversed(results.pred[0]):
|
| 22 |
# label = f'{model.names[int(cls)]} {conf:.2f}'
|