bear classification
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def greet(name):
|
| 4 |
-
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from huggingface_hub import from_pretrained_fastai
|
| 3 |
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
learner = from_pretrained_fastai("hdchild/bear")
|
| 6 |
+
|
| 7 |
+
def predict(image):
|
| 8 |
+
return learner.predict(image)[0]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
iface = gr.Interface(fn=predict, inputs="image", outputs="text", capture_session=True)
|
| 12 |
iface.launch()
|