Remove wrong download script
Browse files- EgoSpeak.py +0 -69
EgoSpeak.py
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
from datasets import DatasetInfo, Features, GeneratorBasedBuilder, Split, Value
|
4 |
-
|
5 |
-
|
6 |
-
class EgoSpeak(GeneratorBasedBuilder):
|
7 |
-
"""EgoSpeak Dataset with EasyCom, Ego4D, and YTConv subdirectories."""
|
8 |
-
|
9 |
-
VERSION = "1.0.0"
|
10 |
-
|
11 |
-
def _info(self):
|
12 |
-
return DatasetInfo(
|
13 |
-
description="EgoSpeak dataset containing precomputed features from EasyCom, Ego4D, and YTConv.",
|
14 |
-
features=Features(
|
15 |
-
{
|
16 |
-
"sub_dir": Value("string"),
|
17 |
-
"src_video_filename": Value("string"),
|
18 |
-
"file_path": Value("string"),
|
19 |
-
}
|
20 |
-
),
|
21 |
-
homepage="https://huggingface.co/datasets/kjunh/EgoSpeak",
|
22 |
-
license="CC BY-NC 4.0",
|
23 |
-
citation="""\
|
24 |
-
@article{egospeak,
|
25 |
-
title={...}
|
26 |
-
author={NAME},
|
27 |
-
journal={ArXiv/Conference},
|
28 |
-
year={2024}
|
29 |
-
}
|
30 |
-
""",
|
31 |
-
)
|
32 |
-
|
33 |
-
def _split_generators(self, dl_manager):
|
34 |
-
# Use the Hugging Face cache directory as the default
|
35 |
-
data_dir = os.path.abspath(dl_manager.manual_dir or dl_manager.cache_dir)
|
36 |
-
|
37 |
-
# If no data is available in the cache or provided manually, raise an error
|
38 |
-
if not os.listdir(data_dir):
|
39 |
-
raise ValueError(
|
40 |
-
"Dataset requires data to be present in the Hugging Face cache or manually specified. "
|
41 |
-
"Please provide the `data_dir` parameter or ensure the dataset is cached correctly. "
|
42 |
-
"For example: `load_dataset('kjunh/EgoSpeak', data_dir='/path/to/dataset')`."
|
43 |
-
)
|
44 |
-
|
45 |
-
return [
|
46 |
-
SplitGenerator(
|
47 |
-
name=Split.TRAIN,
|
48 |
-
gen_kwargs={"data_dir": data_dir},
|
49 |
-
),
|
50 |
-
]
|
51 |
-
|
52 |
-
|
53 |
-
def _generate_examples(self, data_dir):
|
54 |
-
"""Generate examples from the dataset directory structure."""
|
55 |
-
idx = 0
|
56 |
-
for root, dirs, files in os.walk(data_dir):
|
57 |
-
# Filter for .npy files
|
58 |
-
for file_name in files:
|
59 |
-
if file_name.endswith(".npy"):
|
60 |
-
file_path = os.path.join(root, file_name)
|
61 |
-
sub_dir = os.path.relpath(root, data_dir)
|
62 |
-
src_video_filename = file_name.replace(".npy", "")
|
63 |
-
|
64 |
-
yield idx, {
|
65 |
-
"sub_dir": sub_dir,
|
66 |
-
"src_video_filename": src_video_filename,
|
67 |
-
"file_path": file_path,
|
68 |
-
}
|
69 |
-
idx += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|