hwberry2 commited on
Commit
176eb71
·
1 Parent(s): 1225352

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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=2, validation_split=0.9)
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", type="numpy", image_mode="L", shape=[28,28], invert_colors=True)
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)