Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chxw20 committed Apr 25, 2021
1 parent a8888c9 commit 2b5c634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BAN_vqa/kairos/adaptive_detection_features_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def extract(split, infiles, task='scenario_data'):
reader = csv.DictReader(tsv_in_file, delimiter='\t', fieldnames=FIELDNAMES)
for item in reader:
item['num_boxes'] = int(item['num_boxes'])
image_id = int(item['img_id'])
image_id = item['img_id']
if image_id in imgids:
num_boxes += item['num_boxes']
else:
Expand Down Expand Up @@ -105,7 +105,7 @@ def extract(split, infiles, task='scenario_data'):
item['num_boxes'] = int(item['num_boxes'])
item['boxes'] = bytes(item['boxes'], 'utf')
item['features'] = bytes(item['features'], 'utf')
image_id = int(item['img_id'])
image_id = item['img_id']
image_w = float(item['img_w'])
image_h = float(item['img_h'])
bboxes = np.frombuffer(
Expand Down
3 changes: 2 additions & 1 deletion BAN_vqa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def load_imageid(folder):
images = load_folder(folder, 'jpg')
img_ids = set()
for img in images:
img_id = int(img.split('/')[-1].split('.')[0].split('_')[-1])
# img_id = int(img.split('/')[-1].split('.')[0].split('_')[-1])
img_id = img.split('/')[-1].split('.')[0]
img_ids.add(img_id)
return img_ids

Expand Down

0 comments on commit 2b5c634

Please sign in to comment.