Poe Dator commited on
Commit
b7fbb48
1 Parent(s): 1f7ef74

upd charting, filtering

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -73,15 +73,18 @@ for lbl, score in res:
73
  if score >=1:
74
  st.markdown(f"[ {lbl:<7}] {labels_decoder[lbl]:<35} {score:.1f}%")
75
 
76
-
77
- fig, ax = plt.subplots()
78
  total=0
79
  for r in res:
80
  if total < 95:
81
- ax.barh(r[0], r[1])
82
  total += r[1]
83
  else:
84
  break
85
- st.pyplot()
 
 
 
 
86
 
87
  st.markdown(f"cycle time = {time() - start_time:.2f} s.")
 
73
  if score >=1:
74
  st.markdown(f"[ {lbl:<7}] {labels_decoder[lbl]:<35} {score:.1f}%")
75
 
76
+ res_plot = []
 
77
  total=0
78
  for r in res:
79
  if total < 95:
80
+ res_plot.append(r)
81
  total += r[1]
82
  else:
83
  break
84
+
85
+ fig, ax = plt.subplots(figsize=(10, len(res_plot)+1))
86
+ for r in res_plot :
87
+ ax.barh(r[0], r[1])
88
+ st.pyplot(fig)
89
 
90
  st.markdown(f"cycle time = {time() - start_time:.2f} s.")