Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from model import predict_fruit_type
|
| 3 |
+
|
| 4 |
+
def predict(img):
|
| 5 |
+
return predict_fruit_type(img)
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
interface_options = {
|
| 9 |
+
"title": "Blueberries, Avacados or Dragon Fruit?",
|
| 10 |
+
"description": "Yoooo this is my college assignment. A VGG-16 model that predicts the fruit type.",
|
| 11 |
+
# "interpretation": "default",
|
| 12 |
+
"layout": "horizontal",
|
| 13 |
+
"examples": [
|
| 14 |
+
"./blue_berry_1.jpg", "./avacado_1.jpg",
|
| 15 |
+
"./dragon_fruit_1.jpg", './cranberry_1.jpg',
|
| 16 |
+
'./jackfruit_1.jpg', './muskmelon_1.jpg',
|
| 17 |
+
'./pineapple_1.jpg', './banana_1.jpg',
|
| 18 |
+
'./orange_1.jpg', './watermelon_1.jpg',
|
| 19 |
+
],
|
| 20 |
+
"allow_flagging": "never",
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
demo = gr.Interface(
|
| 24 |
+
fn=predict,
|
| 25 |
+
inputs=gr.inputs.Image(shape=(480, 480)),
|
| 26 |
+
outputs=gr.outputs.Textbox(type="auto", label=None),
|
| 27 |
+
**interface_options,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
demo.launch(share=False)
|