Merge branch 'main' of https://huggingface.co/datasets/faridlab/deepaction_v1
Browse files- README.md +1 -2
- deepaction_v1.py +23 -9
README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
---
|
| 2 |
-
license: openrail
|
| 3 |
viewer: false
|
| 4 |
tags:
|
| 5 |
- deepfakes
|
|
@@ -192,7 +191,7 @@ Included below are example videos generated using the prompt "a person taking a
|
|
| 192 |
|
| 193 |
## Licensing
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
<br>
|
| 198 |
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
viewer: false
|
| 3 |
tags:
|
| 4 |
- deepfakes
|
|
|
|
| 191 |
|
| 192 |
## Licensing
|
| 193 |
|
| 194 |
+
The AI-generated videos (folders BDAnimateDiffLightning, CogVideoX5B, RunwayML, StableDiffusion, Veo, and VideoPoet) are released under <a href='https://creativecommons.org/licenses/by/4.0/deed.en'>the CC BY 4.0 license</a>. The real videos (folder Pexels) are released under <a href='https://www.pexels.com/license/'>the Pexels license</a>.
|
| 195 |
|
| 196 |
<br>
|
| 197 |
|
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,8 +37,21 @@ class DeepActionV1(datasets.GeneratorBasedBuilder):
|
|
| 35 |
)
|
| 36 |
|
| 37 |
def _split_generators(self, dl_manager):
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
return [
|
| 42 |
datasets.SplitGenerator(
|
|
@@ -46,12 +61,11 @@ class DeepActionV1(datasets.GeneratorBasedBuilder):
|
|
| 46 |
]
|
| 47 |
|
| 48 |
def _generate_examples(self, data_dir):
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
subfolder_path = os.path.join(label_dir, subfolder)
|
| 55 |
if os.path.isdir(subfolder_path):
|
| 56 |
for video_file in os.listdir(subfolder_path):
|
| 57 |
if video_file.endswith(".mp4"):
|
|
|
|
| 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/resolve/main/"
|
| 42 |
+
|
| 43 |
+
for engine in SUPPORTED:
|
| 44 |
+
for i in list(range(95)) + list(range(99, 104)):
|
| 45 |
+
if engine in ["Pexels", "Veo"]:
|
| 46 |
+
urls.append(os.path.join(base_url, engine, "{}".format(i), "a.mp4"))
|
| 47 |
+
elif engine in ["VideoPoet"]:
|
| 48 |
+
for vid_file in ["a.mp4", "b.mp4", "c.mp4", "d.mp4"]:
|
| 49 |
+
urls.append(os.path.join(base_url, engine, "{}".format(i), vid_file))
|
| 50 |
+
else:
|
| 51 |
+
for vid_file in ["a.mp4", "b.mp4", "c.mp4", "d.mp4", "e.mp4"]:
|
| 52 |
+
urls.append(os.path.join(base_url, engine, "{}".format(i), vid_file))
|
| 53 |
+
|
| 54 |
+
data_dir = dl_manager.download_and_extract(urls)
|
| 55 |
|
| 56 |
return [
|
| 57 |
datasets.SplitGenerator(
|
|
|
|
| 61 |
]
|
| 62 |
|
| 63 |
def _generate_examples(self, data_dir):
|
| 64 |
+
for label in os.listdir(data_dir):
|
| 65 |
+
label_path = os.path.join(data_dir, label)
|
| 66 |
+
if os.path.isdir(label_path):
|
| 67 |
+
for subfolder in os.listdir(label_path):
|
| 68 |
+
subfolder_path = os.path.join(label_path, subfolder)
|
|
|
|
| 69 |
if os.path.isdir(subfolder_path):
|
| 70 |
for video_file in os.listdir(subfolder_path):
|
| 71 |
if video_file.endswith(".mp4"):
|