Srastog's picture
Sit 2
d805bce
raw
history blame
549 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("/generate")
def display(text: str):
return {"yoy":text}
"""@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()}"""