File size: 310 Bytes
7d3ce75
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from fastapi import FastAPI, UploadFile, File
from cnnmodels import classify_tumor

app = FastAPI(title="Brain Tumor CNN Service")

@app.post("/classify")
async def classify(file: UploadFile = File(...)):
    image_bytes = await file.read()
    result = classify_tumor(image_bytes)
    return result