Spaces:
Sleeping
Sleeping
File size: 473 Bytes
65aa0cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
def create_app():
app = FastAPI(
title="Trash Detection API",
description="GLOCO Object Detection API using FastAPI and YOLOv8",
docs_url="/"
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
return app
|