Commit
·
a7da9bb
1
Parent(s):
01a18a5
prueba
Browse files
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from fastai.learner import load_learner
|
| 3 |
-
from fastai.vision.core import PILImage
|
| 4 |
-
from huggingface_hub import hf_hub_download
|
| 5 |
|
| 6 |
|
| 7 |
-
learner = load_learner(hf_hub_download("jdmartinev/intel_image_classification_fastai","model.pkl"))
|
| 8 |
|
| 9 |
def classify_image(image):
|
| 10 |
-
img = PILImage.create(image)
|
| 11 |
-
pred_class, pred_idx, outputs = learn.predict(img)
|
| 12 |
-
return
|
| 13 |
-
|
| 14 |
|
| 15 |
demo = gr.Interface(classify_image, gr.Image(shape=(224, 224)), "text")
|
| 16 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
#from fastai.learner import load_learner
|
| 3 |
+
#from fastai.vision.core import PILImage
|
| 4 |
+
#from huggingface_hub import hf_hub_download
|
| 5 |
|
| 6 |
|
| 7 |
+
#learner = load_learner(hf_hub_download("jdmartinev/intel_image_classification_fastai","model.pkl"))
|
| 8 |
|
| 9 |
def classify_image(image):
|
| 10 |
+
#img = PILImage.create(image)
|
| 11 |
+
#pred_class, pred_idx, outputs = learn.predict(img)
|
| 12 |
+
#return(f"Predicted class: {pred_class}")
|
| 13 |
+
return("edificio")
|
| 14 |
|
| 15 |
demo = gr.Interface(classify_image, gr.Image(shape=(224, 224)), "text")
|
| 16 |
demo.launch()
|