The region proposal network refines each anchor box by predicting four offsets: a centre shift scaled by the box size, and a log scale change for width and height. These are the targets the network regresses toward.
Implement box_targets(anchor, gt), returning (tx, ty, tw, th) from the anchor to the ground truth.
Convert both boxes to center and size. Take center differences divided by the anchor size, and log ratios of sizes.
No results yet
Run your code to check it against the examples, or submit to run every test.