-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data module and prefetched videos in Git LFS.
- Loading branch information
Showing
14 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data/*.index filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,6 @@ dmypy.json | |
|
||
# Gradio | ||
gradio_cached_examples/ | ||
|
||
# MacOS | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import json | ||
import shutil | ||
|
||
from videohash import filepath_from_url | ||
|
||
with open('apb2022.json') as filein: | ||
urls, videos, url2video, video2url = [], [], {}, {} | ||
for item in json.load(filein): | ||
urls.append(item['url']) | ||
videos.append(item['mp4']) | ||
url2video[item['url']] = item['mp4'] | ||
video2url[item['mp4']] = item['url'] | ||
|
||
for url in videos: | ||
filepath = filepath_from_url(url) + '.index' | ||
datapath = os.path.join('data', os.path.basename(filepath)) | ||
if not os.path.exists(filepath) and os.path.exists(datapath): | ||
shutil.copyfile(datapath, filepath) | ||
|
||
|
||
if __name__ == "__main__": | ||
from videomatch import get_video_index | ||
|
||
for url in videos: | ||
get_video_index(url) | ||
filepath = filepath_from_url(url) + '.index' | ||
datapath = os.path.join('data', os.path.basename(filepath)) | ||
shutil.copyfile(filepath, datapath) |
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown