Spaces:
Sleeping
Sleeping
from fastapi import FastAPI, File | |
from io import BytesIO | |
from PIL import Image | |
from predict import read_image, transformacao | |
app = FastAPI() | |
async def root(): | |
return {"message": "Idiot, you are in the wrong place!"} | |
async def create_upload_file(file: bytes = File(...)): | |
# read image | |
imagem = read_image(file) | |
# transform and prediction | |
prediction = transformacao(imagem) | |
return prediction | |