Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from fastai.vision.core import PILImage
|
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
|
| 9 |
-
learner = load_learner(hf_hub_download("jdmartinev/
|
| 10 |
|
| 11 |
def classify_image(image):
|
| 12 |
img = PILImage.create(image)
|
|
@@ -14,7 +14,11 @@ def classify_image(image):
|
|
| 14 |
return(f"Predicted class: {pred_class}")
|
| 15 |
|
| 16 |
demo = gr.Interface(classify_image, gr.Image(shape=(224, 224)), "text")
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
|
|
|
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
|
| 9 |
+
learner = load_learner(hf_hub_download("jdmartinev/isitabird","model.pkl"))
|
| 10 |
|
| 11 |
def classify_image(image):
|
| 12 |
img = PILImage.create(image)
|
|
|
|
| 14 |
return(f"Predicted class: {pred_class}")
|
| 15 |
|
| 16 |
demo = gr.Interface(classify_image, gr.Image(shape=(224, 224)), "text")
|
| 17 |
+
|
| 18 |
+
gr.Interface(fn=classify_image,
|
| 19 |
+
inputs=gr.Image(width=224, height=224),
|
| 20 |
+
outputs="textbox").launch()
|
| 21 |
+
|
| 22 |
|
| 23 |
|
| 24 |
|