smonizzzz commited on
Commit
533267f
·
verified ·
1 Parent(s): bfae9aa

Upload show_results.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. show_results.py +16 -0
show_results.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ h = json.load(open('results/scoliosis_hrnet/history.json'))
4
+ t = json.load(open('results/scoliosis_hrnet/test_results.json'))
5
+
6
+ val = h['val']
7
+ best_i = min(range(len(val)), key=lambda i: val[i]['cmae'])
8
+ b = val[best_i]
9
+
10
+ print(f'\n Epoch melhor: {best_i+1}')
11
+ print(f' {"Angulo":<14} {"Validacao":>10} {"Teste":>10}')
12
+ print(f' {"-"*36}')
13
+ print(f' {"CMAE medio":<14} {b["cmae"]:>9.2f}° {t["cmae"]:>9.2f}°')
14
+ print(f' {"Toracico T1":<14} {b["cmae_thoracic1"]:>9.2f}° {t["cmae_thoracic1"]:>9.2f}°')
15
+ print(f' {"Toracico T2":<14} {b["cmae_thoracic2"]:>9.2f}° {t["cmae_thoracic2"]:>9.2f}°')
16
+ print(f' {"Lombar":<14} {b["cmae_lumbar"]:>9.2f}° {t["cmae_lumbar"]:>9.2f}°')