Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ with gr.Blocks() as demo:
|
|
60 |
|
61 |
# train the model - 5 runs
|
62 |
# evaluate the model on the test set
|
63 |
-
model.fit(x_train, y_train, epochs=
|
64 |
test_loss, test_acc = model.evaluate(x_test, y_test, verbose=2)
|
65 |
post_train_results = f"Test accuracy: {test_acc} Test Loss: {test_loss}"
|
66 |
print(post_train_results)
|
@@ -89,7 +89,7 @@ with gr.Blocks() as demo:
|
|
89 |
# Creates the Gradio interface objects
|
90 |
with gr.Row():
|
91 |
with gr.Column(scale=2):
|
92 |
-
image_data = gr.Image(label="Upload Image"
|
93 |
with gr.Column(scale=1):
|
94 |
model_prediction = gr.Text(label="Model Prediction", interactive=False)
|
95 |
image_data.change(classifyImage, image_data, model_prediction)
|
|
|
60 |
|
61 |
# train the model - 5 runs
|
62 |
# evaluate the model on the test set
|
63 |
+
model.fit(x_train, y_train, epochs=5, validation_split=0.3)
|
64 |
test_loss, test_acc = model.evaluate(x_test, y_test, verbose=2)
|
65 |
post_train_results = f"Test accuracy: {test_acc} Test Loss: {test_loss}"
|
66 |
print(post_train_results)
|
|
|
89 |
# Creates the Gradio interface objects
|
90 |
with gr.Row():
|
91 |
with gr.Column(scale=2):
|
92 |
+
image_data = gr.Image(label="Upload Image")
|
93 |
with gr.Column(scale=1):
|
94 |
model_prediction = gr.Text(label="Model Prediction", interactive=False)
|
95 |
image_data.change(classifyImage, image_data, model_prediction)
|