UnFaZeD07 commited on
Commit
2bae69b
·
verified ·
1 Parent(s): 5a6f53f

Add files using upload-large-folder tool

Browse files
AVVP_dataset_full.csv ADDED
The diff for this file is too large to render. See raw diff
 
llp_download.py ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ import shutil
4
+ import sys
5
+
6
+ from loguru import logger
7
+ from tqdm import tqdm
8
+
9
+ from concurrent.futures import ThreadPoolExecutor, as_completed
10
+
11
+
12
+ LINK_PREFIX = "https://www.youtube.com/watch?v="
13
+
14
+
15
+ def download_video(video_dir: Path, name: str, time_range):
16
+ video_dir.mkdir(exist_ok=True)
17
+ path_full_video = str((video_dir / f"{name}_full_video.mp4").absolute())
18
+ path_trimmed_video = video_dir / f"{name}.mp4"
19
+
20
+ if path_trimmed_video.exists():
21
+ logger.info(f"{path_trimmed_video} exists.")
22
+ return
23
+
24
+ path_trimmed_video = str(path_trimmed_video.absolute())
25
+
26
+ video_link = LINK_PREFIX + name
27
+
28
+ logger.info(f"Downloading full video to: {path_full_video}")
29
+ command1 = f"yt-dlp {video_link} --js-runtime node --remote-components ejs:github --cookies cookies.txt "
30
+ command1 += "-o " + path_full_video + " "
31
+ command1 += "-f best "
32
+ logger.debug(command1)
33
+ os.system(command1)
34
+
35
+ if not os.path.exists(path_full_video):
36
+ logger.error("Full video not found. Aborting")
37
+ return
38
+
39
+ t_start, t_end = time_range
40
+ t_dur = t_end - t_start
41
+ logger.info("Trim the video to [%.1f-%.1f]" % (t_start, t_end))
42
+
43
+ command2 = "ffmpeg "
44
+ command2 += "-ss "
45
+ command2 += str(t_start) + " "
46
+ command2 += "-i "
47
+ command2 += path_full_video + " "
48
+ command2 += "-t "
49
+ command2 += str(t_dur) + " "
50
+ command2 += "-vcodec libx264 "
51
+ command2 += "-acodec aac -strict -2 "
52
+ command2 += path_trimmed_video + " "
53
+ command2 += "-y " # overwrite without asking
54
+ command2 += "-loglevel info " # print no log
55
+ os.system(command2)
56
+
57
+ logger.info(f"Download complete for {path_trimmed_video}")
58
+
59
+
60
+ def download_from_csv(video_dir, csv_file):
61
+ video_dir = Path(video_dir)
62
+ with open(csv_file, "r") as f:
63
+ data = f.readlines()[1:]
64
+
65
+ length = len(data)
66
+ logger.info(f"Total number of videos to download {length}")
67
+
68
+ names, segments = [], {}
69
+ futures = []
70
+
71
+ with ThreadPoolExecutor(max_workers=1) as executor:
72
+ for line in data:
73
+ if not line:
74
+ continue
75
+
76
+ vid, _ = line.split("\t")
77
+ name, time_range = vid[:11], vid[11:].split("_")
78
+ t_start = float(time_range[1])
79
+ t_end = t_start + 10
80
+ segments[name] = (t_start, t_end)
81
+ names.append(name)
82
+
83
+ futures.append(
84
+ executor.submit(download_video, video_dir, name, segments[name])
85
+ )
86
+
87
+ for future in tqdm(as_completed(futures), total=len(futures)):
88
+ future.result()
89
+
90
+ print(len(segments))
91
+
92
+
93
+ def check_unavailable(video_dir, csv_file):
94
+ video_dir = Path(video_dir)
95
+ with open(csv_file, "r") as f:
96
+ data = f.readlines()[1:]
97
+
98
+ missing = 0
99
+ for line in tqdm(data):
100
+ vid, _ = line.split("\t")
101
+ name = vid[:11]
102
+
103
+ path = video_dir / f"{name}.mp4"
104
+ if not path.exists():
105
+ missing += 1
106
+
107
+ logger.info(f"Total :{len(data)}, missing: {missing}")
108
+
109
+
110
+ def move_raw():
111
+ videos = os.listdir("videos")
112
+ os.makedirs("raw_videos", exist_ok=True)
113
+
114
+ for video in videos:
115
+ video_path = os.path.join("videos", video)
116
+ if not video.endswith("full_video.mp4"):
117
+ continue
118
+ shutil.move(video_path, "raw_videos")
119
+
120
+
121
+
122
+ try:
123
+ cookie_path = "cookies.txt"
124
+ if not os.path.exists(cookie_path):
125
+ logger.warning(
126
+ "Cookies not found. Please export your browser's cookie and paste it as `cookies.txt`."
127
+ )
128
+ sys.exit(1)
129
+ download_from_csv("videos", "AVVP_dataset_full.csv")
130
+ move_raw()
131
+ except KeyboardInterrupt:
132
+ logger.error("Keyboard interrupt")
133
+ sys.exit(1)
videos/0MLdH_ddoJk.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25e35582024a67d3998b2dc8acf00c5fa2b382054b70040d6660ff87eda49bdf
3
+ size 6722525
videos/16k-hKzQqKc.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0d89b3b62b9aac5f50d83c5907645bfc3e7bc0f9351ae84da18fadbcdddc9e6
3
+ size 1297518
videos/1v8lZF8BBtY.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5428325c9dafac72502b578cdc5ed7bd496ef6831b723b069c7ae444674e99fc
3
+ size 2654251
videos/2RtDgTm6rn4.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b13742fbb24c7938dbc7b06310025b0730f457bacc662cb57607e8600cdec929
3
+ size 273634
videos/2YEhKhUt6qQ.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44406e922b7c6eb62be3ba08d8a3c8f18361a20a9d65446005b728a2c0b66f90
3
+ size 1428252
videos/2n1ns5DGScc.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71bc54376533d64fb579afebe484a798266e0a1576116da1664fc25f3dd5b4fc
3
+ size 401383
videos/3ERn2kwnfA4.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72db8de7f461a94a07554f8149623826c6f13fee45f74f1a3bc4cfdc36752dd3
3
+ size 659940
videos/3FZ2-hz0ZNY.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21a11f53f085ef1c6059786d9368a349fb1b86c732ad3692308fcaf7c2732da7
3
+ size 412438
videos/47kDSAP4A_0.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a50fcbddc5feab3610700c5f214e6eb7c96460e33d2cb6e9c4e8d4fdb6051abb
3
+ size 1147995
videos/4QunyreAYM4.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:749a42ec135e080c2f216f54f3295058e547d3834bdd6f6ddb7a37307760154c
3
+ size 3114828
videos/585sVgKWYHg.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5af9191f661918e2390b9f8f300e52840b9cf9b2e61b814154d004052e87813
3
+ size 534485
videos/7-Pb33nUWKI.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d05688011047f48ff138c4016b856b5bb9ccc1d30c72954fa910c03dcdcddd50
3
+ size 4230365
videos/79_RmvHnZOU.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cc57bea1c2ce4461474150554af8d88a6b94d3ac9a9ed7ea46585d39e53377b
3
+ size 180197
videos/84vFdTtO2Vk.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c890b17b0aae475fddc2a8ac0e0fcfed621a5208559645ccd4d04f32389fac17
3
+ size 798279
videos/8L6AX8xepUI.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6aa0f4ec125068a7998322df42ffeaf2c6bd20b0b4fc2389108fe04b3dcf3cc1
3
+ size 1634606
videos/9-grzj23Bos.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc756ab10053b9d0a65cee38b38e33ab079d010974cc8f0d16abb0ab39a96bc1
3
+ size 1341813
videos/9Dy77y_zVrM.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ef2da3fc47fc84229bba1b61a1ddb52c13efbe1aa81d6907d6b3e95665c04d9
3
+ size 10896304
videos/A-udweYxo3g.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b3ea54795cd04a9ca26db0c77f3cc7470682d83c61d947f0997652970433c90
3
+ size 545404
videos/AFTnODCx828.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b900baceea865c5ae2cf05d35f0a8c3a12a731602422243baf76642ffc8552b
3
+ size 211747
videos/BcUrwkum-nQ.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceac560bd34a92cf9429ef81de6df79564f3ffe9b89722d03dce3dbf401466eb
3
+ size 1107192
videos/CIOwWhJiT5w.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d460daf65af25e33e7e1c0180124bb74e3af0cf1b93ac8fe855d54b7e2c3497
3
+ size 2785323
videos/CfGQHe4KF1I.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1d8998e4e98aa1cf9cff9bb627513382793dd79e7d86508ca05fddb8606ffde
3
+ size 3362123
videos/CmU6Obv2tU8.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22026a4e92a8434918ed875aef5f7750846d7072ef3e9994aa295a5497459555
3
+ size 718734
videos/DpfED0AZg2U.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04bee42cbad32352c0e18804a07a034cc84955df30530d509b2c9a37255386a5
3
+ size 6156124
videos/Dr4GrylmP9M.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ed9725ae191ef4459c576f0a8815093e0e32b156a18d046972a955ff2d44414
3
+ size 4298020
videos/EgvAozAo-sU.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0b6cec2d14dd09c3ef3ac78dcdc9ac8317610a3e39944ae4c4cd95a3a0c619a
3
+ size 284989
videos/EsEJh7JuX-0.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a248e2471a7c50373e15f9aa1611bc71833eb73506a1461f51334edd04b6cbf7
3
+ size 1794855
videos/FD_AHY-4uaA.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e6a76b7349dbf1e56159a113568d7c6b86f94f9b45b8e9a8f442dc4fb3bba9f
3
+ size 864902
videos/FnbGdv-P-7A.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a85370e3f011b2d3050981c770defc00714e2df503748b0d69cf305627e82e23
3
+ size 353506
videos/G7AWneQ124I.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b764dbe5f3c2ea29b29cfd02cb1838de49ab80a3b9ff9095251a5f4d1ebf265
3
+ size 612913
videos/GSWybGaQQdc.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80f0de8dcbc53721dc5bfb851a70003fc764fa511ac9796f5dfca226bd8d4b60
3
+ size 979274
videos/HMoZBbpPBFk.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79a29d84e2f407fe113492602e3b76582585632093f2e8dabd1a99442c7a080d
3
+ size 1299980
videos/Ip3SFk3NsfE.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41f60ca92a0960f9bbea75cab9fea350cd92ef6276c4568e2028cb1196daa094
3
+ size 400677
videos/JEIJ3Sn_0WU.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:540fc99ed739184722f2d86bd1f9d639463330ee12e5b7349c1d40f76df11542
3
+ size 3499219
videos/JVnyQw8ORJQ.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6055ef5a993ed4689ab258eab2051358879aa9d89e667f98a2b373e39055fc2e
3
+ size 1458742
videos/JdYxbaszdxs.mp4 ADDED
File without changes
videos/JquimytXI2U.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:703aa322ff6936e7dfe7ef0ad367c8b93101526a21f6fb9a783b154c1c961f3e
3
+ size 4824328
videos/JurJCOlwHnI.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7558804efc634068fc6dc929a8c695e3b10cfc309f5252209c0905d568f38ab8
3
+ size 1230421
videos/KBiCMiP4eNw.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:924fb9b718c63d8d32198beab4ee4ca0b5d5765e7da12248ef466307d461ac96
3
+ size 838706
videos/LGeLv_bEBSA.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:279bd42ac428cf64df46ee8d51751250a3ae938155014e31ac5ab7782b59bae9
3
+ size 552429
videos/LZ6oDntUV2c.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a2103bfc5d0b153ac9da51d0494da8400f32453e368470e08e297e2072cc2fa
3
+ size 7995239
videos/MR_VGmBrWYo.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37535e7d2810a27f974b996645f5619fc37ac4fe2baa890f4fee9ae3e73df107
3
+ size 1553978
videos/Nz7srsastlk.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43cddfbbdd36aaedc26c630c5c7c50e7bd98a174de0d3b8253860076056b5d74
3
+ size 609603
videos/OAzPNdL-wQI.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02044a34e52da8e1e5c94018e9006b8037fb888ac75c1d3ed3c3a00532f8a550
3
+ size 4829399
videos/OP1HwnpjoX8.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82c955e161376caffa88563a70be57bb1d3c6e4a882b046ab2ef761ae1e59d3c
3
+ size 3506915
videos/OTattrwc_Qc.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:480ea80a628b6375053d43b9cc1c54d5bfa927efbfb2df5578ecf8fb25257526
3
+ size 3347235
videos/P8CQi4teroA.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a08bcc1c5d0545eac946ca32be9a2e74508442132ab963feec55b50de25ee58
3
+ size 2532295
videos/PAsI01GRYlY.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6369eb1738e08f3592a7be6996b7ec0edbbc011ecabfca8a1b9f56deab2fd2fa
3
+ size 1198370