Skip to content

Commit

Permalink
Update rtdetr_transformer.py
Browse files Browse the repository at this point in the history
[w, h] is mis-written to [h, w]
which makes anchors error
  • Loading branch information
h-bo authored Jul 25, 2023
1 parent 2d22a7c commit 7b2c0ef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def _generate_anchors(self,
end=w, dtype=dtype))
grid_xy = paddle.stack([grid_x, grid_y], -1)

valid_WH = paddle.to_tensor([h, w]).astype(dtype)
valid_WH = paddle.to_tensor([w, h]).astype(dtype)
grid_xy = (grid_xy.unsqueeze(0) + 0.5) / valid_WH
wh = paddle.ones_like(grid_xy) * grid_size * (2.0**lvl)
anchors.append(
Expand Down

0 comments on commit 7b2c0ef

Please sign in to comment.