jitesh commited on
Commit
9d0f3da
1 Parent(s): 93ec191

adds plot placeholder

Browse files
Files changed (3) hide show
  1. data/img/c1plot.png +0 -0
  2. data/img/c2plot.png +0 -0
  3. src/read_logs.py +10 -4
data/img/c1plot.png ADDED
data/img/c2plot.png ADDED
src/read_logs.py CHANGED
@@ -8,6 +8,7 @@ from os import listdir
8
  from .lib import set_input, create_dowload_button
9
  from os.path import isfile, join, exists
10
  import printj
 
11
 
12
 
13
  class LogAnalyser:
@@ -26,6 +27,7 @@ class LogAnalyser:
26
  # if 'df' not in st.session_state:
27
  # self.df=0
28
  st.markdown(self.get_text())
 
29
 
30
  @staticmethod
31
  @st.cache
@@ -58,6 +60,11 @@ class LogAnalyser:
58
  # st.session_state.path=self.path
59
 
60
  self.update_df()
 
 
 
 
 
61
  if self.debug:
62
  self.get_c1_plot()
63
  self.get_c2_plot()
@@ -133,7 +140,8 @@ class LogAnalyser:
133
  ),
134
 
135
  )
136
- st.plotly_chart(fig, use_container_width=True)
 
137
  def get_c2_plot(self):
138
  # c2_threshold=0
139
  c2_threshold_list = np.arange(0, 1, 0.01)
@@ -171,9 +179,7 @@ class LogAnalyser:
171
  ),
172
 
173
  )
174
- st.plotly_chart(fig, use_container_width=True)
175
- # fig.show()
176
- pass
177
 
178
  @staticmethod
179
  def get_subset_condition(data, story_id):
8
  from .lib import set_input, create_dowload_button
9
  from os.path import isfile, join, exists
10
  import printj
11
+ import cv2
12
 
13
 
14
  class LogAnalyser:
27
  # if 'df' not in st.session_state:
28
  # self.df=0
29
  st.markdown(self.get_text())
30
+ self.placeholder = dict()
31
 
32
  @staticmethod
33
  @st.cache
60
  # st.session_state.path=self.path
61
 
62
  self.update_df()
63
+ for name in ['c1plot', 'c2plot']:
64
+ self.placeholder[name] = st.empty()
65
+ image = cv2.imread(f'data/img/{name}.png')
66
+ image=cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
67
+ self.placeholder[name].image(image)
68
  if self.debug:
69
  self.get_c1_plot()
70
  self.get_c2_plot()
140
  ),
141
 
142
  )
143
+ # st.plotly_chart(fig, use_container_width=True)
144
+ self.placeholder['c1plot'].plotly_chart(fig, use_container_width=True)
145
  def get_c2_plot(self):
146
  # c2_threshold=0
147
  c2_threshold_list = np.arange(0, 1, 0.01)
179
  ),
180
 
181
  )
182
+ self.placeholder['c2plot'].plotly_chart(fig, use_container_width=True)
 
 
183
 
184
  @staticmethod
185
  def get_subset_condition(data, story_id):