diff --git a/server.py b/server.py index cae86a4..9d02827 100644 --- a/server.py +++ b/server.py @@ -8,6 +8,7 @@ from pathlib import Path import datetime import numpy as np +from pydantic import BaseModel app = FastAPI() @@ -44,3 +45,14 @@ async def predict(image: UploadFile): prediction = [] return {"prediction": prediction} +class Item(BaseModel): + name: str + +@app.post("/home") +async def home(item: Item): + return { + 'prediction': [{ + 'name': item['name'] + }] + } + diff --git a/static/index.html b/static/index.html index b22e2c2..193df48 100644 --- a/static/index.html +++ b/static/index.html @@ -160,9 +160,13 @@