Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
from PIL import Image
|
| 2 |
-
import tempfile
|
| 3 |
import gradio as gr
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Resto do c贸digo aqui...
|
| 6 |
|
|
@@ -31,7 +31,7 @@ def classify_image(image_path, model_name):
|
|
| 31 |
return label, probability
|
| 32 |
|
| 33 |
inputs = [
|
| 34 |
-
gr.inputs.Image(label="Eye image"),
|
| 35 |
gr.inputs.Dropdown(choices=[m["name"] for m in models], label="Model"),
|
| 36 |
]
|
| 37 |
|
|
@@ -41,8 +41,8 @@ outputs = [
|
|
| 41 |
]
|
| 42 |
|
| 43 |
examples = [
|
| 44 |
-
[
|
| 45 |
-
[
|
| 46 |
]
|
| 47 |
|
| 48 |
gr.Interface(classify_image, inputs, outputs, examples=examples).launch()
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import tensorflow as tf
|
| 3 |
+
import numpy as np
|
| 4 |
|
| 5 |
# Resto do c贸digo aqui...
|
| 6 |
|
|
|
|
| 31 |
return label, probability
|
| 32 |
|
| 33 |
inputs = [
|
| 34 |
+
gr.inputs.Image(shape=(224, 224), label="Eye image"),
|
| 35 |
gr.inputs.Dropdown(choices=[m["name"] for m in models], label="Model"),
|
| 36 |
]
|
| 37 |
|
|
|
|
| 41 |
]
|
| 42 |
|
| 43 |
examples = [
|
| 44 |
+
[np.zeros((224, 224, 3)), "my_model.h5"],
|
| 45 |
+
[np.ones((224, 224, 3)) * 255, "my_model_2.h5"],
|
| 46 |
]
|
| 47 |
|
| 48 |
gr.Interface(classify_image, inputs, outputs, examples=examples).launch()
|