Spaces:
Sleeping
Sleeping
Translate UI strings to English
Browse files- .DS_Store +0 -0
- README.md +2 -2
- __pycache__/app.cpython-314.pyc +0 -0
- app.py +14 -14
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
README.md
CHANGED
|
@@ -3,7 +3,7 @@ title: MoveTSA Dataset Builder
|
|
| 3 |
colorFrom: blue
|
| 4 |
colorTo: indigo
|
| 5 |
sdk: gradio
|
| 6 |
-
sdk_version:
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
| 9 |
hf_oauth: true
|
|
@@ -46,4 +46,4 @@ code needed.
|
|
| 46 |
| `CODE_REPO` | variable (optional) | Pipeline-code dataset id (default `thbndi/MoveTSA`). |
|
| 47 |
|
| 48 |
> First load downloads ~13 GB of raw SIMU logs; expect a slow cold start. Enable
|
| 49 |
-
> **persistent storage** on the Space to avoid re-downloading on each restart.
|
|
|
|
| 3 |
colorFrom: blue
|
| 4 |
colorTo: indigo
|
| 5 |
sdk: gradio
|
| 6 |
+
sdk_version: 5.9.1
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
| 9 |
hf_oauth: true
|
|
|
|
| 46 |
| `CODE_REPO` | variable (optional) | Pipeline-code dataset id (default `thbndi/MoveTSA`). |
|
| 47 |
|
| 48 |
> First load downloads ~13 GB of raw SIMU logs; expect a slow cold start. Enable
|
| 49 |
+
> **persistent storage** on the Space to avoid re-downloading on each restart.
|
__pycache__/app.cpython-314.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-314.pyc and b/__pycache__/app.cpython-314.pyc differ
|
|
|
app.py
CHANGED
|
@@ -52,11 +52,11 @@ def generate(window_size, overlap, normalize, include_baselines,
|
|
| 52 |
include_familiarization, profile: gr.OAuthProfile | None):
|
| 53 |
"""Run the pipeline with the chosen parameters and return a parquet file."""
|
| 54 |
if profile is None:
|
| 55 |
-
return None, "🔒
|
| 56 |
if profile.username.lower() not in ALLOWLIST:
|
| 57 |
return None, (
|
| 58 |
-
f"⛔
|
| 59 |
-
f"
|
| 60 |
)
|
| 61 |
|
| 62 |
df = build_windows(
|
|
@@ -73,18 +73,18 @@ def generate(window_size, overlap, normalize, include_baselines,
|
|
| 73 |
f"_{normalize}.parquet")
|
| 74 |
out = os.path.join(tempfile.mkdtemp(), fname)
|
| 75 |
df.to_parquet(out, index=False)
|
| 76 |
-
msg = (f"✅ **{len(df)}
|
| 77 |
-
f"({df['subject'].nunique()}
|
| 78 |
return out, msg
|
| 79 |
|
| 80 |
|
| 81 |
with gr.Blocks(title="MoveTSA dataset builder") as demo:
|
| 82 |
gr.Markdown(
|
| 83 |
-
"#
|
| 84 |
-
"
|
| 85 |
-
"
|
| 86 |
-
"
|
| 87 |
-
"1.
|
| 88 |
)
|
| 89 |
gr.LoginButton()
|
| 90 |
with gr.Row():
|
|
@@ -95,13 +95,13 @@ with gr.Blocks(title="MoveTSA dataset builder") as demo:
|
|
| 95 |
normalize = gr.Dropdown(["zscore", "center", "none"],
|
| 96 |
value="zscore", label="normalize")
|
| 97 |
include_baselines = gr.Checkbox(
|
| 98 |
-
value=True, label="
|
| 99 |
include_familiarization = gr.Checkbox(
|
| 100 |
-
value=True, label="
|
| 101 |
-
btn = gr.Button("
|
| 102 |
with gr.Column():
|
| 103 |
status = gr.Markdown()
|
| 104 |
-
out_file = gr.File(label="
|
| 105 |
|
| 106 |
btn.click(
|
| 107 |
generate,
|
|
|
|
| 52 |
include_familiarization, profile: gr.OAuthProfile | None):
|
| 53 |
"""Run the pipeline with the chosen parameters and return a parquet file."""
|
| 54 |
if profile is None:
|
| 55 |
+
return None, "🔒 Sign in with your Hugging Face account to generate."
|
| 56 |
if profile.username.lower() not in ALLOWLIST:
|
| 57 |
return None, (
|
| 58 |
+
f"⛔ Access not granted for **@{profile.username}**.\n\n"
|
| 59 |
+
f"Request access from **@{OWNER}** (to be added to the allowlist)."
|
| 60 |
)
|
| 61 |
|
| 62 |
df = build_windows(
|
|
|
|
| 73 |
f"_{normalize}.parquet")
|
| 74 |
out = os.path.join(tempfile.mkdtemp(), fname)
|
| 75 |
df.to_parquet(out, index=False)
|
| 76 |
+
msg = (f"✅ **{len(df)} windows × {df.shape[1]} columns** "
|
| 77 |
+
f"({df['subject'].nunique()} subjects) — `{fname}`")
|
| 78 |
return out, msg
|
| 79 |
|
| 80 |
|
| 81 |
with gr.Blocks(title="MoveTSA dataset builder") as demo:
|
| 82 |
gr.Markdown(
|
| 83 |
+
"# MoveTSA dataset builder\n"
|
| 84 |
+
"Generate a **parametrised HRV / BSI / RSP / simulator** parquet from the "
|
| 85 |
+
"(private) raw recordings. You download **only** the generated parquet — "
|
| 86 |
+
"never the raw data.\n\n"
|
| 87 |
+
"1. Sign in with Hugging Face. 2. Set the parameters. 3. Generate."
|
| 88 |
)
|
| 89 |
gr.LoginButton()
|
| 90 |
with gr.Row():
|
|
|
|
| 95 |
normalize = gr.Dropdown(["zscore", "center", "none"],
|
| 96 |
value="zscore", label="normalize")
|
| 97 |
include_baselines = gr.Checkbox(
|
| 98 |
+
value=True, label="include baselines (B1–B4)")
|
| 99 |
include_familiarization = gr.Checkbox(
|
| 100 |
+
value=True, label="include familiarization (F)")
|
| 101 |
+
btn = gr.Button("Generate parquet", variant="primary")
|
| 102 |
with gr.Column():
|
| 103 |
status = gr.Markdown()
|
| 104 |
+
out_file = gr.File(label="generated parquet")
|
| 105 |
|
| 106 |
btn.click(
|
| 107 |
generate,
|