Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
import fastai
|
3 |
from fastai.vision import *
|
4 |
from fastai.vision.learner import load_learner
|
5 |
-
from PIL import Image
|
6 |
import gradio as gr
|
7 |
|
8 |
# Load the model
|
@@ -11,7 +11,7 @@ model = load_learner("model.pkl")
|
|
11 |
# Define an image classification function
|
12 |
def classify_image(image):
|
13 |
# Preprocess the image
|
14 |
-
image =
|
15 |
|
16 |
# Make a prediction
|
17 |
prediction = model.predict(image)[0]
|
|
|
2 |
import fastai
|
3 |
from fastai.vision import *
|
4 |
from fastai.vision.learner import load_learner
|
5 |
+
from PIL import Image
|
6 |
import gradio as gr
|
7 |
|
8 |
# Load the model
|
|
|
11 |
# Define an image classification function
|
12 |
def classify_image(image):
|
13 |
# Preprocess the image
|
14 |
+
image = Image.create(image).resize((192, 192))
|
15 |
|
16 |
# Make a prediction
|
17 |
prediction = model.predict(image)[0]
|