svjack commited on
Commit
321014a
·
1 Parent(s): 825cf2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -184,6 +184,7 @@ def image_click(images, evt: gr.SelectData,
184
  #### corr_array
185
  corr_array = corr_array_df.loc[cols].iloc[:, :top_k].values
186
  l_list = pd.Series(corr_array.reshape([-1])).values.tolist()
 
187
  l_dist_list = []
188
  for ele in l_list:
189
  if ele not in l_dist_list:
@@ -223,4 +224,5 @@ with gr.Blocks() as demo:
223
  outputs = [sdg_outputs, sg_outputs],)
224
 
225
 
 
226
  demo.launch("0.0.0.0")
 
184
  #### corr_array
185
  corr_array = corr_array_df.loc[cols].iloc[:, :top_k].values
186
  l_list = pd.Series(corr_array.reshape([-1])).values.tolist()
187
+ l_list = pd.Series(l_list).map(Image.open).map(lambda x: expand2square(x, (0, 0, 0))).values.tolist()
188
  l_dist_list = []
189
  for ele in l_list:
190
  if ele not in l_dist_list:
 
224
  outputs = [sdg_outputs, sg_outputs],)
225
 
226
 
227
+
228
  demo.launch("0.0.0.0")