Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ INPUT_H = INPUT_W = 512 # what you trained with
|
|
| 16 |
THRESH = 0.5 # binarisation
|
| 17 |
DEEP_SUP = False
|
| 18 |
ALPHA = 0.40 # overlay transparency
|
| 19 |
-
ALLOWED_FRONT = "https://amitabhm1.github.io" # GitHub‑Pages origin
|
| 20 |
################ -------------------------------------------------
|
| 21 |
|
| 22 |
# ---------------- FastAPI (plus simple CORS) ------------------
|
|
@@ -25,7 +25,7 @@ app = FastAPI(title="Polyp Segmentation API")
|
|
| 25 |
app.add_middleware(
|
| 26 |
CORSMiddleware,
|
| 27 |
allow_origins=[ALLOWED_FRONT, "http://localhost:4173", "http://127.0.0.1:5500"],
|
| 28 |
-
allow_methods=["POST"],
|
| 29 |
allow_headers=["*"],
|
| 30 |
)
|
| 31 |
# --------------- load model once at startup -------------------
|
|
|
|
| 16 |
THRESH = 0.5 # binarisation
|
| 17 |
DEEP_SUP = False
|
| 18 |
ALPHA = 0.40 # overlay transparency
|
| 19 |
+
ALLOWED_FRONT = "https://amitabhm1.github.io/polyp-demo" # GitHub‑Pages origin
|
| 20 |
################ -------------------------------------------------
|
| 21 |
|
| 22 |
# ---------------- FastAPI (plus simple CORS) ------------------
|
|
|
|
| 25 |
app.add_middleware(
|
| 26 |
CORSMiddleware,
|
| 27 |
allow_origins=[ALLOWED_FRONT, "http://localhost:4173", "http://127.0.0.1:5500"],
|
| 28 |
+
allow_methods=["POST", "OPTIONS"],
|
| 29 |
allow_headers=["*"],
|
| 30 |
)
|
| 31 |
# --------------- load model once at startup -------------------
|