chenyuntc / simple-faster-rcnn-pytorch

A simplified implemention of Faster R-CNN that replicate performance from origin paper
Other
3.97k stars 1.14k forks source link

question in the class of ProposalTargetCreator #231

Closed jiang1997 closed 3 years ago

jiang1997 commented 3 years ago

As far as I can see, this class will provide proposal target for the head to calculate loss. But I don't really know the purpose to normalize the "gt_roi_loc" before return them. I also have checked the faster-rcnn implemented in the torchvision and there is no such normalization.

    # Compute offsets and scales to match sampled RoIs to the GTs.
    gt_roi_loc = bbox2loc(sample_roi, bbox[gt_assignment[keep_index]])
    gt_roi_loc = ((gt_roi_loc - np.array(loc_normalize_mean, np.float32)
                   ) / np.array(loc_normalize_std, np.float32))

    return sample_roi, gt_roi_loc, gt_roi_label

https://github.com/chenyuntc/simple-faster-rcnn-pytorch/blob/master/model/utils/creator_tool.py#L129

jiang1997 commented 3 years ago

https://github.com/chenyuntc/simple-faster-rcnn-pytorch/blob/master/model/faster_rcnn.py#L246

Here is a reverse process to the 'roi_cls_loc' when predicting. So it's kind of make sense to me now. Sorry for this superficial question.

jiang1997 commented 3 years ago

I am working on 'Vison Transformer' based on this implementation of Faster RCNN. Feel free to contact me for exchanging ideas!