Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import tensorflow as tf
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
-
from PIL import Image
|
5 |
|
6 |
# Load the model
|
7 |
model = tf.saved_model.load('.')
|
@@ -18,8 +17,8 @@ def predict(image):
|
|
18 |
return predictions.numpy().tolist() # Adjust output processing as needed
|
19 |
|
20 |
# Set up the Gradio interface
|
21 |
-
image_input = gr.
|
22 |
-
label_output = gr.
|
23 |
|
24 |
interface = gr.Interface(fn=predict, inputs=image_input, outputs=label_output)
|
25 |
interface.launch()
|
|
|
1 |
import tensorflow as tf
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
|
|
4 |
|
5 |
# Load the model
|
6 |
model = tf.saved_model.load('.')
|
|
|
17 |
return predictions.numpy().tolist() # Adjust output processing as needed
|
18 |
|
19 |
# Set up the Gradio interface
|
20 |
+
image_input = gr.Image(type="pil")
|
21 |
+
label_output = gr.Label(num_top_classes=3)
|
22 |
|
23 |
interface = gr.Interface(fn=predict, inputs=image_input, outputs=label_output)
|
24 |
interface.launch()
|