Aexysi/ModelAIsoft
0
1from predict import read_image2from predict import transform3from fastapi import FastAPI, File4import numpy as np5import uvicorn6 7app = FastAPI(docs_url='/')8classes = ['Apple', 'Orange', 'Pear']9 10@app.post("/Image uploading/")11async def create_upload_file(file: bytes = File(...)):12 image = read_image(file)13 prediction = transform(image)14 return classes[np.argmax(prediction)]