Arafath10 commited on
Commit
5bab6dc
·
verified ·
1 Parent(s): ad3e3aa

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +11 -0
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