Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
from functions import *
|
| 4 |
+
|
| 5 |
+
examples_dir = 'examples'
|
| 6 |
+
title = "Birds Classification - ResNet34 PyTorch"
|
| 7 |
+
examples = [os.path.join(examples_dir, i) for i in os.listdir('examples')]
|
| 8 |
+
|
| 9 |
+
interface = gr.Interface(fn=predict, inputs=gr.Image(type= 'numpy', shape=(224, 224)).style(height= 256),
|
| 10 |
+
outputs= gr.Label(num_top_classes= 5), cache_examples= False,
|
| 11 |
+
examples= examples, title= title, css= '.gr-box {background-color: rgb(230 230 230);}')
|
| 12 |
+
|
| 13 |
+
interface.launch()
|