Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,12 @@ from PIL import Image
|
|
4 |
import numpy as np
|
5 |
|
6 |
# Load your custom regression model
|
7 |
-
model_path = "
|
8 |
-
model_path = "kia_mnist_keras_model.keras"
|
9 |
|
10 |
#model.load_weights(model_path)
|
11 |
model = tf.keras.models.load_model(model_path)
|
12 |
|
13 |
-
labels = ['
|
14 |
|
15 |
# Define regression function
|
16 |
def predict_regression(image):
|
@@ -26,10 +25,10 @@ def predict_regression(image):
|
|
26 |
|
27 |
# Create Gradio interface
|
28 |
input_image = gr.Image()
|
29 |
-
output_text = gr.Textbox(label="Predicted
|
30 |
interface = gr.Interface(fn=predict_regression,
|
31 |
inputs=input_image,
|
32 |
outputs=gr.Label(),
|
33 |
-
examples=["images/
|
34 |
-
description="A simple mlp classification model for
|
35 |
interface.launch()
|
|
|
4 |
import numpy as np
|
5 |
|
6 |
# Load your custom regression model
|
7 |
+
model_path = "pokemon_transferlearning.keras"
|
|
|
8 |
|
9 |
#model.load_weights(model_path)
|
10 |
model = tf.keras.models.load_model(model_path)
|
11 |
|
12 |
+
labels = ['Porygon', 'Seel', 'Vaporeon']
|
13 |
|
14 |
# Define regression function
|
15 |
def predict_regression(image):
|
|
|
25 |
|
26 |
# Create Gradio interface
|
27 |
input_image = gr.Image()
|
28 |
+
output_text = gr.Textbox(label="Predicted Pokemon")
|
29 |
interface = gr.Interface(fn=predict_regression,
|
30 |
inputs=input_image,
|
31 |
outputs=gr.Label(),
|
32 |
+
examples=["images/porygon.jpeg", "images/seel.jpeg", "images/vaporeon.jpeg"],
|
33 |
+
description="A simple mlp classification model for pokemon classification.")
|
34 |
interface.launch()
|