Commit
·
06a7ec4
1
Parent(s):
b4fbfa4
chore: update builder
Browse files- how2sign-clips.py +10 -5
how2sign-clips.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# Copyright 2023 Thinh T. Duong
|
| 2 |
import os
|
| 3 |
import datasets
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
logger = datasets.logging.get_logger(__name__)
|
|
@@ -16,7 +17,7 @@ _HOMEPAGE = "https://how2sign.github.io/index.html"
|
|
| 16 |
_REPO_URL = "https://huggingface.co/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 |
|
|
@@ -82,9 +83,11 @@ class How2SignClips(datasets.GeneratorBasedBuilder):
|
|
| 82 |
_URLS["meta"].format(split=split)
|
| 83 |
),
|
| 84 |
"video_dir": dl_manager.download_and_extract(
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
| 88 |
)
|
| 89 |
),
|
| 90 |
},
|
|
@@ -108,7 +111,9 @@ class How2SignClips(datasets.GeneratorBasedBuilder):
|
|
| 108 |
split="train",
|
| 109 |
)
|
| 110 |
for i, sample in enumerate(dataset):
|
| 111 |
-
video_path = os.path.join(
|
|
|
|
|
|
|
| 112 |
yield i, {
|
| 113 |
"id": sample["id"],
|
| 114 |
"type": sample["type"],
|
|
|
|
| 1 |
# Copyright 2023 Thinh T. Duong
|
| 2 |
import os
|
| 3 |
import datasets
|
| 4 |
+
from glob import glob
|
| 5 |
|
| 6 |
|
| 7 |
logger = datasets.logging.get_logger(__name__)
|
|
|
|
| 17 |
_REPO_URL = "https://huggingface.co/VieSignLang/how2sign-clips/resolve/main"
|
| 18 |
_URLS = {
|
| 19 |
"meta": f"{_REPO_URL}/metadata/" + "{split}.parquet",
|
| 20 |
+
"video": f"{_REPO_URL}/videos/" + "{type}/{split}/*.zip",
|
| 21 |
}
|
| 22 |
|
| 23 |
|
|
|
|
| 83 |
_URLS["meta"].format(split=split)
|
| 84 |
),
|
| 85 |
"video_dir": dl_manager.download_and_extract(
|
| 86 |
+
glob(
|
| 87 |
+
_URLS["video"].format(
|
| 88 |
+
type=self.config.name,
|
| 89 |
+
split=split
|
| 90 |
+
)
|
| 91 |
)
|
| 92 |
),
|
| 93 |
},
|
|
|
|
| 111 |
split="train",
|
| 112 |
)
|
| 113 |
for i, sample in enumerate(dataset):
|
| 114 |
+
video_path = os.path.join(
|
| 115 |
+
video_dir, sample["view"], sample["id"] + ".mp4"
|
| 116 |
+
)
|
| 117 |
yield i, {
|
| 118 |
"id": sample["id"],
|
| 119 |
"type": sample["type"],
|