vedAi / main.py
randomshit11's picture
Upload 2 files
7d51abb verified
raw
history blame
460 Bytes
from fastapi import FastAPI, File
from io import BytesIO
from PIL import Image
from predict import read_image, transformacao
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Idiot, you are in the wrong place!"}
@app.post("/uploadfile/")
async def create_upload_file(file: bytes = File(...)):
# read image
imagem = read_image(file)
# transform and prediction
prediction = transformacao(imagem)
return prediction