Use snapshot_download and local BIDS loading in examples
Browse files
README.md
CHANGED
|
@@ -31,8 +31,11 @@ pip install "datasets[bids] @ git+https://github.com/bruAristimunha/datasets@fea
|
|
| 31 |
|
| 32 |
```python
|
| 33 |
from datasets import load_dataset
|
|
|
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
row = dataset[0]
|
| 37 |
recording = row["biosignal"]
|
| 38 |
print(recording)
|
|
@@ -43,7 +46,7 @@ print(row["metadata"])
|
|
| 43 |
There are 10 subjects and
|
| 44 |
112 recordings in the complete mirror.
|
| 45 |
The example may select one subject; all subjects are stored here.
|
| 46 |
-
|
| 47 |
|
| 48 |
|
| 49 |
## Source and attribution
|
|
|
|
| 31 |
|
| 32 |
```python
|
| 33 |
from datasets import load_dataset
|
| 34 |
+
from huggingface_hub import snapshot_download
|
| 35 |
|
| 36 |
+
path = snapshot_download("EEGDash/nm000290", repo_type="dataset")
|
| 37 |
+
|
| 38 |
+
dataset = load_dataset("bids", data_dir=path, split="train")
|
| 39 |
row = dataset[0]
|
| 40 |
recording = row["biosignal"]
|
| 41 |
print(recording)
|
|
|
|
| 46 |
There are 10 subjects and
|
| 47 |
112 recordings in the complete mirror.
|
| 48 |
The example may select one subject; all subjects are stored here.
|
| 49 |
+
The snapshot download preserves companion files and sidecars. Local recordings are opened lazily.
|
| 50 |
|
| 51 |
|
| 52 |
## Source and attribution
|