Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Video Augmented Texts Data
|
2 |
+
|
3 |
+
### VATEX
|
4 |
+
|
5 |
+
Each video contains 10 captions. In `vatex.zip`, there are:
|
6 |
+
|
7 |
+
* `test/`: a folder containing all available videos
|
8 |
+
* `vatex_public_test_english_v1.1.json`: JSON file containing all captions
|
9 |
+
|
10 |
+
Example data loading:
|
11 |
+
|
12 |
+
```py
|
13 |
+
import os
|
14 |
+
import json
|
15 |
+
|
16 |
+
path = 'vatex_public_test_english_v1.1.json'
|
17 |
+
d = json.load(open(path, 'r'))
|
18 |
+
|
19 |
+
captions = {v['videoID']: v['enCap'] for v in d}
|
20 |
+
|
21 |
+
for vname in captions:
|
22 |
+
video_path = os.path.join('test', vname+'.mp4') # path to the video
|
23 |
+
captions = captions[vname] # a list of 10 str
|
24 |
+
```
|
25 |
+
|
26 |
+
### MSR-VTT
|
27 |
+
|
28 |
+
Each video contains 1 caption. There are two files for MSR-VTT:
|
29 |
+
|
30 |
+
* `MSRVTT.zip`: contains all videos
|
31 |
+
* `MSRVTT_JSFUSION_test.csv`: contains all captions
|
32 |
+
|
33 |
+
Example data loading:
|
34 |
+
|
35 |
+
```py
|
36 |
+
import os
|
37 |
+
import pandas as pd
|
38 |
+
|
39 |
+
path = 'MSRVTT_JSFUSION_test.csv'
|
40 |
+
df = pd.read_csv(path)
|
41 |
+
|
42 |
+
vid_id_list = df['video_id'].tolist()
|
43 |
+
caption_list = df['sentence'].tolist()
|
44 |
+
|
45 |
+
for vid_id, caption in zip(vid_id_list, caption_list):
|
46 |
+
video_path = os.path.join('MSRVTT', 'videos', 'all', vid_id+'.mp4')
|
47 |
+
captions = [caption] # a list of 1 str
|
48 |
+
```
|