Spaces:
Sleeping
Sleeping
Commit
·
4728dd2
1
Parent(s):
20f91f6
update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
-
import utils
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
|
|
|
|
|
|
4 |
|
5 |
def test(csv_file):
|
|
|
|
|
6 |
data_noise = utils.read_train_data(csv_file)
|
7 |
|
8 |
std = np.std(data_noise)
|
@@ -11,13 +15,14 @@ def test(csv_file):
|
|
11 |
d_data = utils.decode_data(data_noise, std, "EEGART")
|
12 |
d_data = d_data[0]
|
13 |
|
14 |
-
|
15 |
|
16 |
-
return
|
17 |
|
18 |
app = gr.Interface(fn=test,
|
19 |
-
inputs=gr.File(label="CSV file"),
|
20 |
-
outputs=gr.
|
|
|
21 |
|
22 |
if __name__ == "__main__":
|
23 |
app.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
+
import os
|
4 |
+
import utils
|
5 |
+
from pathlib import Path
|
6 |
|
7 |
def test(csv_file):
|
8 |
+
#tmp_file_path = Path(str(csv_file)).parent
|
9 |
+
|
10 |
data_noise = utils.read_train_data(csv_file)
|
11 |
|
12 |
std = np.std(data_noise)
|
|
|
15 |
d_data = utils.decode_data(data_noise, std, "EEGART")
|
16 |
d_data = d_data[0]
|
17 |
|
18 |
+
utils.save_data(d_data, "EEGART_test.csv")
|
19 |
|
20 |
+
return "EEGART_test.csv"
|
21 |
|
22 |
app = gr.Interface(fn=test,
|
23 |
+
inputs=gr.File(label="CSV file", file_types=[".csv"]),
|
24 |
+
outputs=gr.File(),
|
25 |
+
allow_flagging="never")
|
26 |
|
27 |
if __name__ == "__main__":
|
28 |
app.launch()
|