Commit
·
9855936
1
Parent(s):
8b82e75
chore: update builder
Browse files- how2sign-clips.py +7 -3
how2sign-clips.py
CHANGED
|
@@ -15,8 +15,8 @@ _DESCRIPTION = """
|
|
| 15 |
_HOMEPAGE = "https://how2sign.github.io/index.html"
|
| 16 |
_REPO_URL = "https://huggingface.co/datasets/VieSignLang/how2sign-clips/resolve/main"
|
| 17 |
_URLS = {
|
| 18 |
-
"meta": f"{_REPO_URL}/metadata/" + "{split}.parquet",
|
| 19 |
-
"video": f"{_REPO_URL}/videos/" + "{type}/{split}
|
| 20 |
}
|
| 21 |
|
| 22 |
|
|
@@ -110,9 +110,13 @@ class How2SignClips(datasets.GeneratorBasedBuilder):
|
|
| 110 |
split="train",
|
| 111 |
)
|
| 112 |
for i, sample in enumerate(dataset):
|
|
|
|
|
|
|
| 113 |
for video_dir in video_dirs:
|
| 114 |
video_path = os.path.join(
|
| 115 |
-
video_dir,
|
|
|
|
|
|
|
| 116 |
)
|
| 117 |
if os.path.exists(video_path):
|
| 118 |
yield i, {
|
|
|
|
| 15 |
_HOMEPAGE = "https://how2sign.github.io/index.html"
|
| 16 |
_REPO_URL = "https://huggingface.co/datasets/VieSignLang/how2sign-clips/resolve/main"
|
| 17 |
_URLS = {
|
| 18 |
+
"meta": f"{_REPO_URL}/metadata/" + "sharded_{split}.parquet",
|
| 19 |
+
"video": f"{_REPO_URL}/videos/" + "{type}/{split}/*/*.zip",
|
| 20 |
}
|
| 21 |
|
| 22 |
|
|
|
|
| 110 |
split="train",
|
| 111 |
)
|
| 112 |
for i, sample in enumerate(dataset):
|
| 113 |
+
num_shards = len(video_dirs)
|
| 114 |
+
shard_idx = sample["shard"]
|
| 115 |
for video_dir in video_dirs:
|
| 116 |
video_path = os.path.join(
|
| 117 |
+
video_dir,
|
| 118 |
+
f"shard_{shard_idx:03d}_{num_shards:03d}",
|
| 119 |
+
sample["id"] + ".mp4"
|
| 120 |
)
|
| 121 |
if os.path.exists(video_path):
|
| 122 |
yield i, {
|