Upload inference.py with huggingface_hub
Browse files- inference.py +8 -0
inference.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
from ultralytics import YOLO
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
def run_inference(image_path):
|
| 6 |
+
model = YOLO('model.pt')
|
| 7 |
+
results = model(image_path)
|
| 8 |
+
return results
|