Sujit Pal commited on
Commit
862e020
1 Parent(s): 4a841d0

fix: replace st.beta_column with st.column

Browse files
dashboard_featurefinder.py CHANGED
@@ -152,7 +152,7 @@ def app():
152
  patch_ranks = get_image_ranks(patch_probs)
153
  pid = 0
154
  for i in range(num_rows):
155
- cols = st.beta_columns(num_cols)
156
  for col in cols:
157
  caption = "#{:d} p({:s})={:.3f}".format(
158
  patch_ranks[pid] + 1, searched_feature, patch_probs[pid])
 
152
  patch_ranks = get_image_ranks(patch_probs)
153
  pid = 0
154
  for i in range(num_rows):
155
+ cols = st.columns(num_cols)
156
  for col in cols:
157
  caption = "#{:d} p({:s})={:.3f}".format(
158
  patch_ranks[pid] + 1, searched_feature, patch_probs[pid])
dashboard_image2image.py CHANGED
@@ -80,13 +80,13 @@ def app():
80
  """)
81
 
82
  suggest_idx = -1
83
- col0, col1, col2, col3, col4 = st.beta_columns(5)
84
  col0.image(get_image_thumbnail(example_image_list[0]))
85
  col1.image(get_image_thumbnail(example_image_list[1]))
86
  col2.image(get_image_thumbnail(example_image_list[2]))
87
  col3.image(get_image_thumbnail(example_image_list[3]))
88
  col4.image(get_image_thumbnail(example_image_list[4]))
89
- col0t, col1t, col2t, col3t, col4t = st.beta_columns(5)
90
  with col0t:
91
  if st.button("Image-1"):
92
  suggest_idx = 0
@@ -102,13 +102,13 @@ def app():
102
  with col4t:
103
  if st.button("Image-5"):
104
  suggest_idx = 4
105
- col5, col6, col7, col8, col9 = st.beta_columns(5)
106
  col5.image(get_image_thumbnail(example_image_list[5]))
107
  col6.image(get_image_thumbnail(example_image_list[6]))
108
  col7.image(get_image_thumbnail(example_image_list[7]))
109
  col8.image(get_image_thumbnail(example_image_list[8]))
110
  col9.image(get_image_thumbnail(example_image_list[9]))
111
- col5t, col6t, col7t, col8t, col9t = st.beta_columns(5)
112
  with col5t:
113
  if st.button("Image-6"):
114
  suggest_idx = 5
@@ -154,7 +154,7 @@ def app():
154
  if image_name is not None and result_filename == image_name:
155
  continue
156
  caption = "{:s} (score: {:.3f})".format(result_filename, 1.0 - score)
157
- col1, col2, col3 = st.beta_columns([2, 10, 10])
158
  col1.markdown("{:d}.".format(rank + 1))
159
  col2.image(Image.open(os.path.join(IMAGES_DIR, result_filename)),
160
  caption=caption)
@@ -164,4 +164,4 @@ def app():
164
  col3.markdown("".join(caption_text))
165
  rank += 1
166
  st.markdown("---")
167
- suggest_idx = -1
 
80
  """)
81
 
82
  suggest_idx = -1
83
+ col0, col1, col2, col3, col4 = st.columns(5)
84
  col0.image(get_image_thumbnail(example_image_list[0]))
85
  col1.image(get_image_thumbnail(example_image_list[1]))
86
  col2.image(get_image_thumbnail(example_image_list[2]))
87
  col3.image(get_image_thumbnail(example_image_list[3]))
88
  col4.image(get_image_thumbnail(example_image_list[4]))
89
+ col0t, col1t, col2t, col3t, col4t = st.columns(5)
90
  with col0t:
91
  if st.button("Image-1"):
92
  suggest_idx = 0
 
102
  with col4t:
103
  if st.button("Image-5"):
104
  suggest_idx = 4
105
+ col5, col6, col7, col8, col9 = st.columns(5)
106
  col5.image(get_image_thumbnail(example_image_list[5]))
107
  col6.image(get_image_thumbnail(example_image_list[6]))
108
  col7.image(get_image_thumbnail(example_image_list[7]))
109
  col8.image(get_image_thumbnail(example_image_list[8]))
110
  col9.image(get_image_thumbnail(example_image_list[9]))
111
+ col5t, col6t, col7t, col8t, col9t = st.columns(5)
112
  with col5t:
113
  if st.button("Image-6"):
114
  suggest_idx = 5
 
154
  if image_name is not None and result_filename == image_name:
155
  continue
156
  caption = "{:s} (score: {:.3f})".format(result_filename, 1.0 - score)
157
+ col1, col2, col3 = st.columns([2, 10, 10])
158
  col1.markdown("{:d}.".format(rank + 1))
159
  col2.image(Image.open(os.path.join(IMAGES_DIR, result_filename)),
160
  caption=caption)
 
164
  col3.markdown("".join(caption_text))
165
  rank += 1
166
  st.markdown("---")
167
+ suggest_idx = -1
dashboard_text2image.py CHANGED
@@ -41,7 +41,7 @@ def app():
41
  "lakes"
42
  ]
43
  st.text("Some suggested queries to start you off with...")
44
- col0, col1, col2, col3, col4, col5, col6 = st.beta_columns(7)
45
  # [1, 1.1, 1.3, 1.1, 1, 1, 1])
46
  suggest_idx = -1
47
  with col0:
@@ -76,7 +76,7 @@ def app():
76
  result_filenames = [filenames[id] for id in ids]
77
  for rank, (result_filename, score) in enumerate(zip(result_filenames, distances)):
78
  caption = "{:s} (score: {:.3f})".format(result_filename, 1.0 - score)
79
- col1, col2, col3 = st.beta_columns([2, 10, 10])
80
  col1.markdown("{:d}.".format(rank + 1))
81
  col2.image(Image.open(os.path.join(IMAGES_DIR, result_filename)),
82
  caption=caption)
@@ -85,4 +85,4 @@ def app():
85
  caption_text.append("* {:s}\n".format(caption))
86
  col3.markdown("".join(caption_text))
87
  st.markdown("---")
88
- suggest_idx = -1
 
41
  "lakes"
42
  ]
43
  st.text("Some suggested queries to start you off with...")
44
+ col0, col1, col2, col3, col4, col5, col6 = st.columns(7)
45
  # [1, 1.1, 1.3, 1.1, 1, 1, 1])
46
  suggest_idx = -1
47
  with col0:
 
76
  result_filenames = [filenames[id] for id in ids]
77
  for rank, (result_filename, score) in enumerate(zip(result_filenames, distances)):
78
  caption = "{:s} (score: {:.3f})".format(result_filename, 1.0 - score)
79
+ col1, col2, col3 = st.columns([2, 10, 10])
80
  col1.markdown("{:d}.".format(rank + 1))
81
  col2.image(Image.open(os.path.join(IMAGES_DIR, result_filename)),
82
  caption=caption)
 
85
  caption_text.append("* {:s}\n".format(caption))
86
  col3.markdown("".join(caption_text))
87
  st.markdown("---")
88
+ suggest_idx = -1