V2A-Sonic / test_try.py
kaiw7's picture
Add files using upload-large-folder tool
2e3a57c verified
raw
history blame contribute delete
661 Bytes
import os
import pandas as pd
# '/inspire/hdd/ws-f4d69b29-e0a5-44e6-bd92-acf4de9990f0/gaopeng/zhoutao-240108120126/datasets/audio-visual/vggsound/vggsound.csv' #
csv_path = '/inspire/hdd/ws-f4d69b29-e0a5-44e6-bd92-acf4de9990f0/gaopeng/public/kwang/datasets/vggsound/vggsound-caption.csv'
df = pd.read_csv(csv_path, header=None, names=['id', 'sec', 'caption', 'split']).to_dict(orient='records')
for row in df:
start_sec = int(row['sec'])
video_id = str(row['id'])
# this is how our videos are named
video_name = f'{video_id}_{start_sec:06d}'
caption = row['caption']
print(start_sec)
print(video_id)
print(caption)
break