Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,11 +63,12 @@ def show_results(input_image: Image.Image):
|
|
| 63 |
perf_plot = "training_performance.png" if os.path.exists("training_performance.png") else None
|
| 64 |
acc_plot = "final_test_accuracy.png" if os.path.exists("final_test_accuracy.png") else None
|
| 65 |
|
| 66 |
-
# Load final test accuracy number
|
| 67 |
-
test_acc_text = "Final
|
| 68 |
-
if
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
return preds, perf_plot, acc_plot, test_acc_text
|
| 73 |
|
|
@@ -84,7 +85,7 @@ interface = gr.Interface(
|
|
| 84 |
gr.Textbox(label='Final Test Accuracy')
|
| 85 |
],
|
| 86 |
title='CIFAR-10 Image Classification with DCLR Optimizer',
|
| 87 |
-
description='Upload an image to see predictions. Training/test plots show benchmark results on CIFAR-10.',
|
| 88 |
examples=example_images
|
| 89 |
)
|
| 90 |
|
|
|
|
| 63 |
perf_plot = "training_performance.png" if os.path.exists("training_performance.png") else None
|
| 64 |
acc_plot = "final_test_accuracy.png" if os.path.exists("final_test_accuracy.png") else None
|
| 65 |
|
| 66 |
+
# Load final test accuracy number
|
| 67 |
+
test_acc_text = "Final test accuracy not available."
|
| 68 |
+
if os.path.exists("final_test_accuracy.txt"):
|
| 69 |
+
with open("final_test_accuracy.txt", "r") as f:
|
| 70 |
+
test_acc_value = f.read().strip()
|
| 71 |
+
test_acc_text = f"Final Test Accuracy: {test_acc_value}%"
|
| 72 |
|
| 73 |
return preds, perf_plot, acc_plot, test_acc_text
|
| 74 |
|
|
|
|
| 85 |
gr.Textbox(label='Final Test Accuracy')
|
| 86 |
],
|
| 87 |
title='CIFAR-10 Image Classification with DCLR Optimizer',
|
| 88 |
+
description='Upload an image to see predictions. Training/test plots and accuracy show benchmark results on CIFAR-10.',
|
| 89 |
examples=example_images
|
| 90 |
)
|
| 91 |
|