audrey06100 commited on
Commit
5e68958
·
verified ·
1 Parent(s): f006739

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +53 -55
app.py CHANGED
@@ -225,65 +225,63 @@ with gr.Blocks() as demo:
225
  with gr.Row():
226
 
227
  with gr.Column(variant='panel'):
228
- with gr.Row(variant='panel'):
229
- with gr.Column():
230
- gr.Markdown("# 1.Channel Mapping")
231
- # --------------------input----------------------
232
- in_loc_file = gr.File(label="Channel locations (.loc, .locs, .xyz, .sfp, .txt)",
233
- file_types=[".loc", "locs", ".xyz", ".sfp", ".txt"])
234
- map_btn = gr.Button("Map")
235
- # -------------------mapping---------------------
236
- desc_md = gr.Markdown(visible=False)
237
- # step1 : initial matching and scaling
238
- with gr.Row():
239
- tpl_img = gr.Image("./template_montage.png", label="Template montage", visible=False)
240
- mapped_img = gr.Image(label="Matching results", visible=False)
241
- # step2 : forward unmatched input channels to empty template channels
242
- radio_group = gr.Radio(elem_id="radio-group", visible=False)
243
- # step3 : fill the remaining template channels
244
- with gr.Row():
245
- in_fillmode = gr.Dropdown(choices=["mean", "zero"],
246
- value="mean",
247
- label="Filling method",
248
- visible=False,
249
- scale=2)
250
- fillmode_btn = gr.Button("OK", visible=False, scale=1)
251
- chkbox_group = gr.CheckboxGroup(elem_id="chkbox-group", visible=False)
252
- # step4 : mapping results
253
- out_json_file = gr.File(visible=False)
254
- res_md = gr.Markdown("""
255
  (Download this file if you plan to run the models using the <a href="">source code</a>.)
256
- """, visible=False)
 
257
 
258
- with gr.Row():
259
- clear_btn = gr.Button("Clear", visible=False)
260
- step2_btn = gr.Button("Next", visible=False)
261
- step3_btn = gr.Button("Next", visible=False)
262
- next_btn = gr.Button("Next step", visible=False)
263
- # -----------------------------------------------
264
 
265
- with gr.Column():
266
- with gr.Row(variant='panel'):
 
 
 
267
  with gr.Column():
268
- gr.Markdown("# 2.Decode Data")
269
- # --------------------input----------------------
270
- with gr.Row():
271
- in_data_file = gr.File(label="Raw data (.csv)", file_types=[".csv"])
272
- with gr.Column():
273
- in_samplerate = gr.Textbox(label="Sampling rate (Hz)")
274
- in_modelname = gr.Dropdown(choices=[
275
- ("ART", "EEGART"),
276
- ("IC-U-Net", "ICUNet"),
277
- ("IC-U-Net++", "UNetpp"),
278
- ("IC-U-Net-Attn", "AttUnet")],
279
- #"(mapped data)"],
280
- value="EEGART",
281
- label="Model")
282
- run_btn = gr.Button(interactive=False)
283
- # --------------------output---------------------
284
- batch_md = gr.Markdown(visible=False)
285
- out_data_file = gr.File(label="Denoised data", visible=False)
286
- # -----------------------------------------------
287
 
288
  with gr.Row():
289
  with gr.Tab("README"):
 
225
  with gr.Row():
226
 
227
  with gr.Column(variant='panel'):
228
+ gr.Markdown("# 1.Channel Mapping")
229
+ # --------------------input----------------------
230
+ in_loc_file = gr.File(label="Channel locations (.loc, .locs, .xyz, .sfp, .txt)",
231
+ file_types=[".loc", "locs", ".xyz", ".sfp", ".txt"])
232
+ map_btn = gr.Button("Map")
233
+ # -------------------mapping---------------------
234
+ desc_md = gr.Markdown(visible=False)
235
+ # step1 : initial matching and scaling
236
+ with gr.Row():
237
+ tpl_img = gr.Image("./template_montage.png", label="Template montage", visible=False)
238
+ mapped_img = gr.Image(label="Matching results", visible=False)
239
+ # step2 : forward unmatched input channels to empty template channels
240
+ radio_group = gr.Radio(elem_id="radio-group", visible=False)
241
+ # step3 : fill the remaining template channels
242
+ with gr.Row():
243
+ in_fillmode = gr.Dropdown(choices=["mean", "zero"],
244
+ value="mean",
245
+ label="Filling method",
246
+ visible=False,
247
+ scale=2)
248
+ fillmode_btn = gr.Button("OK", visible=False, scale=1)
249
+ chkbox_group = gr.CheckboxGroup(elem_id="chkbox-group", visible=False)
250
+ # step4 : mapping results
251
+ out_json_file = gr.File(visible=False)
252
+ res_md = gr.Markdown(
253
+ """
 
254
  (Download this file if you plan to run the models using the <a href="">source code</a>.)
255
+ """,
256
+ visible=False)
257
 
258
+ with gr.Row():
259
+ clear_btn = gr.Button("Clear", visible=False)
260
+ step2_btn = gr.Button("Next", visible=False)
261
+ step3_btn = gr.Button("Next", visible=False)
262
+ next_btn = gr.Button("Next step", visible=False)
263
+ # -----------------------------------------------
264
 
265
+ with gr.Column(variant='panel'):
266
+ gr.Markdown("# 2.Decode Data")
267
+ # --------------------input----------------------
268
+ with gr.Row():
269
+ in_data_file = gr.File(label="Raw data (.csv)", file_types=[".csv"])
270
  with gr.Column():
271
+ in_samplerate = gr.Textbox(label="Sampling rate (Hz)")
272
+ in_modelname = gr.Dropdown(choices=[
273
+ ("ART", "EEGART"),
274
+ ("IC-U-Net", "ICUNet"),
275
+ ("IC-U-Net++", "UNetpp"),
276
+ ("IC-U-Net-Attn", "AttUnet")],
277
+ #"(mapped data)"],
278
+ value="EEGART",
279
+ label="Model")
280
+ run_btn = gr.Button(interactive=False)
281
+ # --------------------output---------------------
282
+ batch_md = gr.Markdown(visible=False)
283
+ out_data_file = gr.File(label="Denoised data", visible=False)
284
+ # -----------------------------------------------
 
 
 
 
 
285
 
286
  with gr.Row():
287
  with gr.Tab("README"):