Delete prune_audio_only.py
Browse files- prune_audio_only.py +0 -52
prune_audio_only.py
DELETED
|
@@ -1,52 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import json
|
| 3 |
-
import glob
|
| 4 |
-
|
| 5 |
-
PAPERLIST_PATHS = ['dataset/pruned_paperlist_iclr2024.json', 'dataset/pruned_paperlist_nips2024.json']
|
| 6 |
-
VIDEO_FOLDER_PATH = 'video'
|
| 7 |
-
|
| 8 |
-
TOTAL_PAPER_COUNT = 0
|
| 9 |
-
MISSING_VIDEO_FOLDER_COUNT = 0
|
| 10 |
-
MISSING_PNG_COUNT = 0
|
| 11 |
-
MISSING_AUDIO_COUNT = 0
|
| 12 |
-
|
| 13 |
-
# read in the paperlist json
|
| 14 |
-
for path in PAPERLIST_PATHS:
|
| 15 |
-
with open(path, 'r') as f:
|
| 16 |
-
paperlist = json.load(f)
|
| 17 |
-
|
| 18 |
-
# for each paper in the paperlist, check if the video exists in the video list
|
| 19 |
-
for paper in paperlist:
|
| 20 |
-
TOTAL_PAPER_COUNT += 1
|
| 21 |
-
video_id = paper['slideslive_id']
|
| 22 |
-
|
| 23 |
-
# check if the video folder exists
|
| 24 |
-
if not os.path.exists(f'{VIDEO_FOLDER_PATH}/{video_id}'):
|
| 25 |
-
print(f'Video {video_id} folder does not exist')
|
| 26 |
-
MISSING_VIDEO_FOLDER_COUNT += 1
|
| 27 |
-
continue
|
| 28 |
-
|
| 29 |
-
# check if the the video folder has at least one png file, print the number of png files if it does
|
| 30 |
-
png_files = glob.glob(f'{VIDEO_FOLDER_PATH}/{video_id}/*.png')
|
| 31 |
-
if len(png_files) == 0:
|
| 32 |
-
print(f'Video {video_id} does not have any png files')
|
| 33 |
-
MISSING_PNG_COUNT += 1
|
| 34 |
-
continue
|
| 35 |
-
else:
|
| 36 |
-
print(f'Video {video_id} has {len(png_files)} png files')
|
| 37 |
-
|
| 38 |
-
# check if the the video folder has an audio file
|
| 39 |
-
if not os.path.exists(f'{VIDEO_FOLDER_PATH}/{video_id}/audio.m4a'):
|
| 40 |
-
print(f'Video {video_id} does not have an audio.m4a file')
|
| 41 |
-
MISSING_AUDIO_COUNT += 1
|
| 42 |
-
continue
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
# print the total counts
|
| 46 |
-
print(f'Total paper count: {TOTAL_PAPER_COUNT}')
|
| 47 |
-
print(f'Missing video folder count: {MISSING_VIDEO_FOLDER_COUNT}')
|
| 48 |
-
print(f'Missing png count: {MISSING_PNG_COUNT}')
|
| 49 |
-
print(f'Missing audio count: {MISSING_AUDIO_COUNT}')
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|