import os
from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from app.services.worker import Worker
from app.routes.health import router as health
from app.routes.analyze import router as submit_analyze
from app.routes.analyze_status import router as get_task_status
from app.routes.analyze_result import router as get_task_result

load_dotenv()
UPLOAD_DIR = os.getenv("UPLOAD_DIR", "uploads")
MOCK = os.getenv("MOCK", "false")
MODEL = os.getenv("MODEL", "segformer")
PREPROCESS = os.getenv("PREPROCESS", "sam3")
WORKER = Worker()

os.makedirs(UPLOAD_DIR, exist_ok=True)

app = FastAPI()
app.mount("/" + UPLOAD_DIR, StaticFiles(directory=UPLOAD_DIR), name=UPLOAD_DIR)
app.include_router(health)
app.include_router(submit_analyze)
app.include_router(get_task_status)
app.include_router(get_task_result)










