audrey06100 commited on
Commit
3ab4789
·
1 Parent(s): 84330fe

update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -5,19 +5,15 @@ import utils
5
  from pathlib import Path
6
 
7
  def test(csv_file):
8
- tmp_file_path = str(Path(str(csv_file)).parent)
9
 
10
- data_noise = utils.read_train_data(csv_file)
 
11
 
12
- std = np.std(data_noise)
13
- avg = np.average(data_noise)
14
-
15
- d_data = utils.decode_data(data_noise, std, "EEGART")
16
- d_data = d_data[0]
17
-
18
- utils.save_data(d_data, tmp_file_path+"/EEGART_test.csv")
19
-
20
- return tmp_file_path+"/EEGART_test.csv"
21
 
22
  app = gr.Interface(fn=test,
23
  inputs=gr.File(label="CSV file", file_types=[".csv"]),
 
5
  from pathlib import Path
6
 
7
  def test(csv_file):
8
+ tmp_filepath = str(Path(str(csv_file)).parent)
9
 
10
+ # step1: Data preprocessing
11
+ total_file_num = utils.preprocessing(csv_file, 256)
12
 
13
+ # step2: Signal reconstruction
14
+ utils.reconstruct("EEGART", total_file_num, tmp_filepath, "EEGART_test.csv")
15
+
16
+ return tmp_filepath+"/EEGART_test.csv"
 
 
 
 
 
17
 
18
  app = gr.Interface(fn=test,
19
  inputs=gr.File(label="CSV file", file_types=[".csv"]),