Srastog's picture
Exp 4
15ec542
raw
history blame
529 Bytes
import numpy as np
from PIL import Image
from fastapi import FastAPI, UploadFile
from utils import classify_img,get_alzheimer_model
app=FastAPI(title="Alzheimer Detection API")
@app.get("/")
def message():
return "Welcome"
"""@app.post("/predict")
def predict(file: UploadFile):
img=Image.open(file.file).convert("RGB")
img=img.resize(480,480)
img=np.array(img)
model= get_alzheimer_model()
label,probability=classify_img(model,img)
return {"label":label.item(),"probability":probability.item()}"""