matybohacek
commited on
Commit
•
af4536e
1
Parent(s):
ff49989
Update deepaction_v1.py
Browse files- deepaction_v1.py +7 -9
deepaction_v1.py
CHANGED
@@ -35,9 +35,8 @@ class DeepActionV1(datasets.GeneratorBasedBuilder):
|
|
35 |
)
|
36 |
|
37 |
def _split_generators(self, dl_manager):
|
38 |
-
|
39 |
-
data_dir = dl_manager.download_and_extract(
|
40 |
-
|
41 |
return [
|
42 |
datasets.SplitGenerator(
|
43 |
name=datasets.Split.TRAIN,
|
@@ -46,12 +45,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"):
|
|
|
35 |
)
|
36 |
|
37 |
def _split_generators(self, dl_manager):
|
38 |
+
repo_url = "https://huggingface.co/datasets/faridlab/deepaction_v1"
|
39 |
+
data_dir = dl_manager.download_and_extract(repo_url)
|
|
|
40 |
return [
|
41 |
datasets.SplitGenerator(
|
42 |
name=datasets.Split.TRAIN,
|
|
|
45 |
]
|
46 |
|
47 |
def _generate_examples(self, data_dir):
|
48 |
+
for label in os.listdir(data_dir):
|
49 |
+
label_path = os.path.join(data_dir, label)
|
50 |
+
if os.path.isdir(label_path):
|
51 |
+
for subfolder in os.listdir(label_path):
|
52 |
+
subfolder_path = os.path.join(label_path, subfolder)
|
|
|
53 |
if os.path.isdir(subfolder_path):
|
54 |
for video_file in os.listdir(subfolder_path):
|
55 |
if video_file.endswith(".mp4"):
|