Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +3 -4
- requirements.txt +0 -0
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
-
from PIL import Image
|
| 5 |
|
| 6 |
# Load the saved model
|
| 7 |
model = tf.keras.models.load_model('mymodel.h5')
|
|
@@ -26,11 +25,11 @@ def classify_image(image):
|
|
| 26 |
return predicted_class
|
| 27 |
|
| 28 |
# Define the Gradio interface
|
| 29 |
-
image_input = gr.Image(type="pil", label="Upload Image")
|
| 30 |
-
label_output = gr.Label()
|
| 31 |
|
| 32 |
# Create the Gradio interface
|
| 33 |
interface = gr.Interface(fn=classify_image, inputs=image_input, outputs=label_output, title="Image Classifier")
|
| 34 |
|
| 35 |
# Launch the interface
|
| 36 |
-
interface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
|
| 5 |
# Load the saved model
|
| 6 |
model = tf.keras.models.load_model('mymodel.h5')
|
|
|
|
| 25 |
return predicted_class
|
| 26 |
|
| 27 |
# Define the Gradio interface
|
| 28 |
+
image_input = gr.inputs.Image(type="pil", label="Upload Image")
|
| 29 |
+
label_output = gr.outputs.Label()
|
| 30 |
|
| 31 |
# Create the Gradio interface
|
| 32 |
interface = gr.Interface(fn=classify_image, inputs=image_input, outputs=label_output, title="Image Classifier")
|
| 33 |
|
| 34 |
# Launch the interface
|
| 35 |
+
interface.launch()
|
requirements.txt
CHANGED
|
Binary files a/requirements.txt and b/requirements.txt differ
|
|
|