Open
Description
Describe the bug
Anchors should be placed ideally in the middle of a grid cell.
However, this is not the case here:
MONAI/monai/apps/detection/utils/anchor_utils.py
Lines 253 to 258 in 12d00ce
Expected behavior
The anchors should be placed ideally in the middle of a grid cell.
Possible fix
This could probably be fixed by simply changing these lines to:
shifts_centers = [
torch.arange(0, size[axis], dtype=torch.int32, device=device) * stride[axis] + int(stride[axis] / 2)
for axis in range(self.spatial_dims)
]