Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -8,13 +8,14 @@ from sahi.utils.cv import read_image_as_pil
|
|
| 8 |
from fastapi import FastAPI, File, UploadFile, Form
|
| 9 |
from utils import tts, read_image_file, pil_to_base64, base64_to_pil, get_hist
|
| 10 |
from typing import Optional
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
# app = FastAPI()
|
| 16 |
-
# defaul_bot_voice = "γγ―γγγγγγγΎγ"
|
| 17 |
-
# area_thres = 0.3
|
| 18 |
app = FastAPI()
|
| 19 |
|
| 20 |
@app.get("/")
|
|
|
|
| 8 |
from fastapi import FastAPI, File, UploadFile, Form
|
| 9 |
from utils import tts, read_image_file, pil_to_base64, base64_to_pil, get_hist
|
| 10 |
from typing import Optional
|
| 11 |
+
from huggingface_hub import hf_hub_download
|
| 12 |
|
| 13 |
+
model_path = hf_hub_download(repo_id="ultralyticsplus/yolov8s", filename='yolov8s.pt')
|
| 14 |
+
model = YOLO(model_path)
|
| 15 |
+
CLASS = model.model.names
|
| 16 |
+
defaul_bot_voice = "γγ―γγγγγγγΎγ"
|
| 17 |
+
area_thres = 0.3
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
app = FastAPI()
|
| 20 |
|
| 21 |
@app.get("/")
|