RFTSystems commited on
Commit
d1138b5
·
verified ·
1 Parent(s): ce46e86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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 if available
67
- test_acc_text = "Final Test Accuracy plot not found."
68
- if acc_plot and os.path.exists("final_test_accuracy.png"):
69
- # You can optionally parse accuracy from a saved file; here we just show a placeholder
70
- test_acc_text = "See bar chart above for final test accuracy."
 
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