Skip to content

Commit 142f851

Browse files
author
doc-doc
committed
initial commit
1 parent ac00e85 commit 142f851

17 files changed

+711
-549
lines changed

.idea/workspace.xml

Lines changed: 191 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NExT-QA <img src="images/logo.png" height="64" width="128">
22

3-
We reproduce some SOTA VideoQA methods to provide benchmark results for our NExT-QA dataset published on CVPR2021 (with 1 Strong Accept and 2 Weak Accepts).
3+
We reproduce some SOTA VideoQA methods to provide benchmark results for our NExT-QA dataset accepted to CVPR2021 (with 1 'Strong Accept' and 2 'Weak Accept's).
44

55
NExT-QA is a VideoQA benchmark targeting the explanation of video contents. It challenges QA models to reason about the causal and temporal actions and understand the rich object interactions in daily activities. We set up both multi-choice and open-ended QA tasks on the dataset. <strong>This repo. provides resources for multi-choice QA</strong>; open-ended QA is found in [NExT-OE](https://github.com/doc-doc/NExT-OE). For more details, please refer to our [dataset](https://doc-doc.github.io/junbin.github.io/docs/nextqa.html) page.
66

@@ -14,12 +14,12 @@ Please create an env for this project using anaconda (should install [anaconda](
1414
>conda create -n videoqa python=3.6.8
1515
>conda activate videoqa
1616
>git clone https://github.com/doc-doc/NExT-QA.git
17-
>pip install -r requirements.txt
17+
>pip install -r requirements.txt #may take some time to install
1818
```
1919
## Data Preparation
2020
Please download the pre-computed features and QA annotations from [here](https://drive.google.com/drive/folders/1gKRR2es8-gRTyP25CvrrVtV6aN5UxttF?usp=sharing). There are 4 zip files:
21-
- ```['vid_feat.zip']```: Appearance and motion feature for video representation.
22-
- ```['qas_bert.zip']```: Finetuned BERT feature for QA-pair representation.
21+
- ```['vid_feat.zip']```: Appearance and motion feature for video representation (with code provided by [HCRN](https://github.com/thaolmk54/hcrn-videoqa)).
22+
- ```['qas_bert.zip']```: Finetuned BERT feature for QA-pair representation (based on [pytorch-pretrained-BERT](https://github.com/LuoweiZhou/pytorch-pretrained-BERT/).
2323
- ```['nextqa.zip']```: Annotations of QAs and GloVe Embeddings.
2424
- ```['models.zip']```: Learned HGA model.
2525

@@ -69,7 +69,7 @@ It will train the model and save to ['models']. (*The results may be slightly di
6969
}
7070
```
7171
## Todo
72-
1. [ ] Open online [evaluation server]() and release test data.
72+
1. [ ] Open [evaluation server]() and release test data.
7373
2. [ ] Release spatial feature.
7474
3. [ ] Release RoI feature.
7575
## Acknowledgement

build_vocab.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import nltk
2-
# nltk.download('punkt')
2+
# nltk.download('punkt') #uncomment it if you are run the first fime
33
import pickle
44
import argparse
55
from utils import load_file, save_file
66
from collections import Counter
77
import string
88

99

10-
1110
class Vocabulary(object):
1211
"""Simple vocabulary wrapper."""
1312
def __init__(self):

eval_mc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from utils import load_file
33

44

5-
def accuracy(sample_list_file, result_file):
5+
def accuracy_metric(sample_list_file, result_file):
66

77
sample_list = load_file(sample_list_file)
88
group = {'CW':[], 'CH':[], 'TN':[], 'TC':[], 'DC':[], 'DL':[], 'DO':[]}
@@ -59,7 +59,7 @@ def main(result_file, mode='val'):
5959
sample_list_file = osp.join(dataset_dir, data_set+'.csv')
6060
print('Evaluating {}'.format(result_file))
6161

62-
accuracy(sample_list_file, result_file)
62+
accuracy_metric(sample_list_file, result_file)
6363

6464

6565

main_qa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def main(args):
1717
num_worker = 8
1818
spatial = False
1919
if spatial:
20-
#STVQA only
20+
#STVQA
2121
video_feature_path = '../data/feats/spatial/'
2222
video_feature_cache = '../data/feats/cache/'
2323
else:
@@ -31,7 +31,7 @@ def main(args):
3131
glove_embed = 'dataset/{}/glove_embed.npy'.format(dataset)
3232
use_bert = True #Otherwise GloVe
3333
checkpoint_path = 'models'
34-
model_type = 'HGA' #(EVQA, STVQA, CoMem, HME, HGA)
34+
model_type = 'CoMem' #(EVQA, CoMem, HME, HGA)
3535
model_prefix= 'bert-ft-h256'
3636

3737
vis_step = 106

networks/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__

0 commit comments

Comments
 (0)