Spaces:
Runtime error
Runtime error
AnishKumbhar
commited on
Commit
•
9363955
1
Parent(s):
acf2d38
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import fastapi
|
2 |
-
from fastapi import FastAPI
|
3 |
from transformers import AutoModelForImageClassification
|
4 |
app = FastAPI()
|
5 |
# Load the model from the local file
|
@@ -21,7 +21,7 @@ def preprocess_image(image):
|
|
21 |
|
22 |
# Define an endpoint to predict the output
|
23 |
@app.post("/predict")
|
24 |
-
async def predict_endpoint(image:
|
25 |
# Preprocess the image
|
26 |
image = preprocess_image(image)
|
27 |
|
|
|
1 |
import fastapi
|
2 |
+
from fastapi import FastAPI,UploadFile
|
3 |
from transformers import AutoModelForImageClassification
|
4 |
app = FastAPI()
|
5 |
# Load the model from the local file
|
|
|
21 |
|
22 |
# Define an endpoint to predict the output
|
23 |
@app.post("/predict")
|
24 |
+
async def predict_endpoint(image: UploadFile):
|
25 |
# Preprocess the image
|
26 |
image = preprocess_image(image)
|
27 |
|