Upload folder using huggingface_hub
Browse files- fixations.zip +3 -0
- nm_marmoset_data.py +57 -0
- responses.zip +3 -0
- stas.zip +3 -0
- stimuli_padded.zip +3 -0
- stimuli_padded_4.zip +3 -0
fixations.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c794f6a901bc1a4b780601696a68a68a5032e2b506078cce83a805aa6e02114
|
| 3 |
+
size 9112539
|
nm_marmoset_data.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import zipfile
|
| 3 |
+
from datasets import DatasetInfo, GeneratorBasedBuilder, SplitGenerator, Split, Features, Value, BuilderConfig
|
| 4 |
+
import shutil
|
| 5 |
+
|
| 6 |
+
class MarmosetConfig(BuilderConfig):
|
| 7 |
+
def __init__(self, unzip_path=None, **kwargs):
|
| 8 |
+
super().__init__(**kwargs)
|
| 9 |
+
self.unzip_path = unzip_path
|
| 10 |
+
|
| 11 |
+
class MarmosetData(GeneratorBasedBuilder):
|
| 12 |
+
BUILDER_CONFIG_CLASS = MarmosetConfig # 🔑 Tell HF to use your custom config
|
| 13 |
+
|
| 14 |
+
BUILDER_CONFIGS = [
|
| 15 |
+
MarmosetConfig(
|
| 16 |
+
name="nm_marmoset_data",
|
| 17 |
+
description="Marmoset data unpacker",
|
| 18 |
+
)
|
| 19 |
+
]
|
| 20 |
+
def _info(self):
|
| 21 |
+
return DatasetInfo(
|
| 22 |
+
description="Unpacks Marmoset natural movie dataset.",
|
| 23 |
+
features=Features({
|
| 24 |
+
"data_dir": Value("string"), # optional metadata
|
| 25 |
+
}),
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
def _split_generators(self, dl_manager):
|
| 29 |
+
# Download & extract the needed files
|
| 30 |
+
path = 'https://huggingface.co/datasets/m-vys/nm_marmoset_data/resolve/main'
|
| 31 |
+
unzip_path = getattr(self.config, 'unzip_path')
|
| 32 |
+
urls = {
|
| 33 |
+
"stas": os.path.join(path, "stas.zip"),
|
| 34 |
+
"responses": os.path.join(path, "responses.zip"),
|
| 35 |
+
"fixations": os.path.join(path, "fixations.zip"),
|
| 36 |
+
"stimuli_padded": os.path.join(path, "stimuli_padded.zip"),
|
| 37 |
+
"stimuli_padded_4": os.path.join(path, "stimuli_padded_4.zip")
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
local_paths = {
|
| 41 |
+
name: dl_manager.download_and_extract(url)
|
| 42 |
+
for name, url in urls.items()
|
| 43 |
+
}
|
| 44 |
+
print('local_paths', local_paths)
|
| 45 |
+
for name, path in local_paths.items():
|
| 46 |
+
src = os.path.join(path, name)
|
| 47 |
+
dst = os.path.join(unzip_path, name)
|
| 48 |
+
print(f'moving {src} to {dst}')
|
| 49 |
+
shutil.move(src, dst)
|
| 50 |
+
|
| 51 |
+
return [SplitGenerator(name=Split.TRAIN, gen_kwargs={"local_paths": local_paths})]
|
| 52 |
+
def _generate_examples(self, local_paths):
|
| 53 |
+
#Return a dictionary matching the features
|
| 54 |
+
print(" Running _generate_examples with data_dir:", local_paths)
|
| 55 |
+
yield 0, {"data_dir": local_paths}
|
| 56 |
+
|
| 57 |
+
|
responses.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c47d31636322553849582e2d2087c970c6d7e59aa06f0377463e727c00b8159f
|
| 3 |
+
size 91470833
|
stas.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b412f467d1f5d129c07c1a53431b187d1f73e5290789051ba7fc8e1f314624e
|
| 3 |
+
size 2419225057
|
stimuli_padded.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c8745be674d9e9e69251cbe08047c2103820736bb336bf5bf4083d19eb795aa
|
| 3 |
+
size 9760517215
|
stimuli_padded_4.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26fcf40d6459f57a5abf49d20265f639417023e6383ab87eca907559c59b5eb5
|
| 3 |
+
size 3085930933
|