Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import tensorflow as tf
|
| 5 |
-
import tensorflow_hub as hub
|
| 6 |
import cv2
|
| 7 |
|
| 8 |
# Load class labels from the text file
|
|
@@ -37,9 +36,9 @@ def predict_image(image):
|
|
| 37 |
label = train_info[top_class] # Get the corresponding label
|
| 38 |
return label
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
input_image = gr.
|
| 42 |
-
output_label = gr.
|
| 43 |
|
| 44 |
# Launch the Gradio interface
|
| 45 |
gr.Interface(fn=predict_image, inputs=input_image, outputs=output_label, capture_session=True).launch()
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import tensorflow as tf
|
|
|
|
| 5 |
import cv2
|
| 6 |
|
| 7 |
# Load class labels from the text file
|
|
|
|
| 36 |
label = train_info[top_class] # Get the corresponding label
|
| 37 |
return label
|
| 38 |
|
| 39 |
+
# Updated Gradio interface
|
| 40 |
+
input_image = gr.Image(shape=(224, 224))
|
| 41 |
+
output_label = gr.Label()
|
| 42 |
|
| 43 |
# Launch the Gradio interface
|
| 44 |
gr.Interface(fn=predict_image, inputs=input_image, outputs=output_label, capture_session=True).launch()
|