rbgirshick / py-faster-rcnn

Faster R-CNN (Python implementation) -- see https://github.com/ShaoqingRen/faster_rcnn for the official MATLAB version
Other
8.1k stars 4.11k forks source link

inaccurate tranform in bbox_transform_inv #328

Open yefanhust opened 8 years ago

yefanhust commented 8 years ago

In py-faster-rcnn/lib/fast-rcnn/bbox_transform.py, there's a function called "bbox_transform_inv". It first converts the shifted anchor coordinates to width, height, center_x, and center_y. The "ctr_x" is computed as follows: ctr_x = boxes[:,0] + 0.5*widths

However, shouldn't ctr_x be computed as boxes[:,0] + 0.5* (widths-1)? This is how it defines in py-faster-rcnn/lib/rpn/generate_anchors.py. Please advise on this, thanks.

duygusar commented 7 years ago

I am not sure, I need to check the code again but I think this was addressed by clipping boxes to image boundaries later on.

yefanhust commented 7 years ago

There's simply an inconsistency in transforming the bounding box between (width, height, center_x, center_y) and (x1,y1,x2,y2). Clipping boxes to image boundaries may not fix this issue. But this hardly has any negative effect on the final results. So hard to be sensed.