Skip to content

Commit

Permalink
Merge pull request #55 from cuiyuhao1996/master
Browse files Browse the repository at this point in the history
fix clevr loader
  • Loading branch information
MIL-VLG committed Dec 25, 2019
2 parents 2feddee + 3e44b57 commit 517bfcf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions openvqa/datasets/clevr/clevr_loader.py
Expand Up @@ -19,10 +19,10 @@ def __init__(self, __C):
# --------------------------

# Loading all image paths
grid_feat_path_list = \
glob.glob(__C.FEATS_PATH[__C.DATASET]['train'] + '/*.npz') + \
glob.glob(__C.FEATS_PATH[__C.DATASET]['val'] + '/*.npz') + \
glob.glob(__C.FEATS_PATH[__C.DATASET]['test'] + '/*.npz')
# grid_feat_path_list = \
# glob.glob(__C.FEATS_PATH[__C.DATASET]['train'] + '/*.npz') + \
# glob.glob(__C.FEATS_PATH[__C.DATASET]['val'] + '/*.npz') + \
# glob.glob(__C.FEATS_PATH[__C.DATASET]['test'] + '/*.npz')

# Loading question word list
stat_ques_list = \
Expand All @@ -37,10 +37,12 @@ def __init__(self, __C):

# Loading question and answer list
self.ques_list = []
grid_feat_path_list = []

split_list = __C.SPLIT[__C.RUN_MODE].split('+')
for split in split_list:
self.ques_list += json.load(open(__C.RAW_PATH[__C.DATASET][split], 'r'))['questions']
grid_feat_path_list += glob.glob(__C.FEATS_PATH[__C.DATASET][split] + '/*.npz')

# Define run data size
self.data_size = self.ques_list.__len__()
Expand Down

0 comments on commit 517bfcf

Please sign in to comment.