Spaces:
Paused
Paused
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| # from app.router import sam_segmentation | |
| from app.router import medsam2_segmentation | |
| app = FastAPI( | |
| title="AI_Capstone", | |
| version="0.1.0", | |
| description="A FastAPI project for AI Capstone", | |
| ) | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # app.include_router(sam_segmentation.router) | |
| app.include_router(medsam2_segmentation.router) | |
| def read_root(): | |
| return {"message": "AI Capstone API is running"} | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run("app.main:app", host="0.0.0.0", port=7860) | |