Update app.py
Browse files
app.py
CHANGED
|
@@ -380,7 +380,7 @@ def infer_custom(file, file_type, clip_idx, top_k, span_half, merge_gap):
|
|
| 380 |
with gr.Blocks(title="REST EEG Seizure Demo") as demo:
|
| 381 |
gr.Markdown("# REST EEG Seizure – CHB-MIT\nDemo chạy trên CPU (Space). Dữ liệu lớn H5 không tự tải để tiết kiệm tài nguyên.")
|
| 382 |
|
| 383 |
-
with gr.Tab("Demo
|
| 384 |
dsel = gr.Dropdown(choices=[str(i) for i in range(len(DEMO_FILES))],
|
| 385 |
label="Chọn demo clip", value="0" if DEMO_FILES else None)
|
| 386 |
dtopk = gr.Slider(1, 50, value=10, step=1, label="Top-k frames to highlight")
|
|
@@ -392,7 +392,7 @@ with gr.Blocks(title="REST EEG Seizure Demo") as demo:
|
|
| 392 |
dfig = gr.Image(label="Frame-wise probability", type="numpy")
|
| 393 |
dbtn.click(fn=infer_demo, inputs=[dsel, dtopk, dspan, dgap], outputs=[dout, dstats, dfig])
|
| 394 |
|
| 395 |
-
with gr.Tab("Upload
|
| 396 |
ftype = gr.Radio(choices=["npz","h5"], value="npz", label="Loại file")
|
| 397 |
fup = gr.File(label="Upload .npz (x, edge_index, edge_weight) hoặc .h5")
|
| 398 |
cidx = gr.Slider(0, 50, value=0, step=1, label="clip_idx (nếu H5)")
|
|
|
|
| 380 |
with gr.Blocks(title="REST EEG Seizure Demo") as demo:
|
| 381 |
gr.Markdown("# REST EEG Seizure – CHB-MIT\nDemo chạy trên CPU (Space). Dữ liệu lớn H5 không tự tải để tiết kiệm tài nguyên.")
|
| 382 |
|
| 383 |
+
with gr.Tab("Demo"):
|
| 384 |
dsel = gr.Dropdown(choices=[str(i) for i in range(len(DEMO_FILES))],
|
| 385 |
label="Chọn demo clip", value="0" if DEMO_FILES else None)
|
| 386 |
dtopk = gr.Slider(1, 50, value=10, step=1, label="Top-k frames to highlight")
|
|
|
|
| 392 |
dfig = gr.Image(label="Frame-wise probability", type="numpy")
|
| 393 |
dbtn.click(fn=infer_demo, inputs=[dsel, dtopk, dspan, dgap], outputs=[dout, dstats, dfig])
|
| 394 |
|
| 395 |
+
with gr.Tab("Upload"):
|
| 396 |
ftype = gr.Radio(choices=["npz","h5"], value="npz", label="Loại file")
|
| 397 |
fup = gr.File(label="Upload .npz (x, edge_index, edge_weight) hoặc .h5")
|
| 398 |
cidx = gr.Slider(0, 50, value=0, step=1, label="clip_idx (nếu H5)")
|