Update deepaction_v1.py
Browse files- deepaction_v1.py +15 -7
deepaction_v1.py
CHANGED
|
@@ -18,6 +18,8 @@ _HOMEPAGE = "https://huggingface.co/datasets/faridlab/deepaction_v1"
|
|
| 18 |
|
| 19 |
_LICENSE = "TBD"
|
| 20 |
|
|
|
|
|
|
|
| 21 |
class DeepActionV1(datasets.GeneratorBasedBuilder):
|
| 22 |
VERSION = datasets.Version("1.0.0")
|
| 23 |
|
|
@@ -26,7 +28,7 @@ class DeepActionV1(datasets.GeneratorBasedBuilder):
|
|
| 26 |
description=_DESCRIPTION,
|
| 27 |
features=datasets.Features({
|
| 28 |
"video": datasets.Video(),
|
| 29 |
-
"label": datasets.ClassLabel(names=
|
| 30 |
}),
|
| 31 |
supervised_keys=("video", "label"),
|
| 32 |
homepage=_HOMEPAGE,
|
|
@@ -35,12 +37,18 @@ class DeepActionV1(datasets.GeneratorBasedBuilder):
|
|
| 35 |
)
|
| 36 |
|
| 37 |
def _split_generators(self, dl_manager):
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
return [
|
| 46 |
datasets.SplitGenerator(
|
|
|
|
| 18 |
|
| 19 |
_LICENSE = "TBD"
|
| 20 |
|
| 21 |
+
SUPPORTED = ["VideoPoet", "BDAnimateDiffLightning", "CogVideoX5B", "Pexels", "RunwayML", "StableDiffusion"] # todo add veo
|
| 22 |
+
|
| 23 |
class DeepActionV1(datasets.GeneratorBasedBuilder):
|
| 24 |
VERSION = datasets.Version("1.0.0")
|
| 25 |
|
|
|
|
| 28 |
description=_DESCRIPTION,
|
| 29 |
features=datasets.Features({
|
| 30 |
"video": datasets.Video(),
|
| 31 |
+
"label": datasets.ClassLabel(names=SUPPORTED), # Add all category names
|
| 32 |
}),
|
| 33 |
supervised_keys=("video", "label"),
|
| 34 |
homepage=_HOMEPAGE,
|
|
|
|
| 37 |
)
|
| 38 |
|
| 39 |
def _split_generators(self, dl_manager):
|
| 40 |
+
urls = []
|
| 41 |
+
base_url = "https://huggingface.co/datasets/faridlab/deepaction_v1/tree/main/"
|
| 42 |
+
|
| 43 |
+
for engine in SUPPORTED:
|
| 44 |
+
for i in range(95) + range(99, 104):
|
| 45 |
+
if engine in ["Pexels", "Veo"]:
|
| 46 |
+
urls.append(os.path.join(base_url, engine, "{}".format(i), "a.mp4"))
|
| 47 |
+
else:
|
| 48 |
+
for vid_file in ["a.mp4", "b.mp4", "c.mp4", "d.mp4", "e.mp4"]
|
| 49 |
+
urls.append(os.path.join(base_url, engine, "{}".format(i), vid_file))
|
| 50 |
+
|
| 51 |
+
data_dir = dl_manager.download_and_extract(url)
|
| 52 |
|
| 53 |
return [
|
| 54 |
datasets.SplitGenerator(
|