Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why the "box_deltas" does't rescale to the raw images space int the test phase #96

Open
chuanxinlan opened this issue Dec 1, 2017 · 0 comments

Comments

@chuanxinlan
Copy link

in the test phase ,you rescale the "rois" result to the raw image space
but I can't understand why don't you also rescale the "bbox_pred" to the raw image space before you get final box by combining the two variables("rois","bbox_pred").
thanks for your time
the detail is in the following code:

     _t['im_postproc'].tic()
    if cfg.TEST.HAS_RPN:
        assert len(im_scales) == 1, "Only single-image batch implemented"
        rois = net.blobs['rois'].data.copy()
        # unscale back to raw image space
        **boxes = rois[:, 1:5] / im_scales[0]**
    if cfg.TEST.SVM:
        # use the raw scores before softmax under the assumption they
        # were trained as linear SVMs
        scores = net.blobs['cls_score'].data
    else:
        # use softmax estimated probabilities
        scores = blobs_out['cls_prob']

    if cfg.TEST.BBOX_REG:
        # Apply bounding-box regression deltas
        **box_deltas = blobs_out['bbox_pred']
        pred_boxes =bbox_transform_inv(boxes,box_deltas)**
        pred_boxes = clip_boxes(pred_boxes, im.shape)
    else:
        # Simply repeat the boxes, once for each class
        pred_boxes = np.tile(boxes, (1, scores.shape[1]))

    if cfg.DEDUP_BOXES > 0 and not cfg.TEST.HAS_RPN:
        # Map scores and predictions back to the original set of boxes
        scores = scores[inv_index, :]
        pred_boxes = pred_boxes[inv_index, :]
    _t['im_postproc'].toc()
@chuanxinlan chuanxinlan changed the title test why the "box_deltas" does't rescale to the raw images space int the test phase Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant