Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import asyncio
|
2 |
from fastapi import FastAPI
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
1 |
+
from ultralytics import YOLO
|
2 |
+
|
3 |
+
# Load a model
|
4 |
+
#model = YOLO('yolov8n-cls.pt') # load an official model
|
5 |
+
model = YOLO('best.pt') # load a custom model
|
6 |
+
|
7 |
+
# Predict with the model
|
8 |
+
results = model('bus.jpg')
|
9 |
+
print(results)# predict on an image
|
10 |
+
|
11 |
+
|
12 |
import asyncio
|
13 |
from fastapi import FastAPI
|
14 |
from fastapi.middleware.cors import CORSMiddleware
|