Skip to content

Commit

Permalink
fix fast rcnn bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanPang committed Oct 10, 2018
1 parent 630687f commit 839c74b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mmdet/datasets/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ def __init__(self,
# color channel order and normalize configs
self.img_norm_cfg = img_norm_cfg
# proposals
self.proposals = mmcv.load(
proposal_file) if proposal_file is not None else None
# TODO: revise _filter_imgs to be more flexible
if proposal_file is not None:
self.proposals = mmcv.load(proposal_file)
ori_ids = self.coco.getImgIds()
sorted_idx = [ori_ids.index(id) for id in self.img_ids]
self.proposals = [self.proposals[idx] for idx in sorted_idx]
else:
self.proposals = None
self.num_max_proposals = num_max_proposals
# flip ratio
self.flip_ratio = flip_ratio
Expand Down Expand Up @@ -271,7 +277,8 @@ def prepare_single(img, scale, flip, proposal=None):
scale_factor=scale_factor,
flip=flip)
if proposal is not None:
_proposal = self.bbox_transform(proposal, scale_factor, flip)
_proposal = self.bbox_transform(proposal, img_shape,
scale_factor, flip)
_proposal = to_tensor(_proposal)
else:
_proposal = None
Expand Down

0 comments on commit 839c74b

Please sign in to comment.