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

🐛 [Fix] image size order inconsistencies #118

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

Adamusen
Copy link
Contributor

@Adamusen Adamusen commented Nov 6, 2024

Fixes the expected order of image_size to be [width, height] in bounding_box_utils.py/generate_anchors function as in the rest of the repository.

Additionally fixes the same issue in the create_auto_anchor functions of the Vec2Box and Anc2Box classes, where the order does not matter, but for the sake of consistency.

fixes #117

Fixes the expected order of image_size to be [width, height] in bounding_box_utils.py/generate_anchors function as in the rest of the repository.

Additionally fixes the same issue in the create_auto_anchor functions of the Vec2Box and Anc2Box classes, where the order does not matter, but for the sake of consistency.
Fixes an additional image_size order related bug in ValidateModel, in which the PostProcessor received the image_size in [height, width] instead of [width, height] order.
Fixes a bug in Anc2Box, where its update function was updating "self.anchor_grid" instead of "self.anchor_grids" as initialized in the __init__() function.
@Adamusen
Copy link
Contributor Author

Adamusen commented Nov 6, 2024

Found and fixed two additional bugs:

1, In yolo/tools/solver.py in ValidateModel the PostProcessor received the image size in the wrong order [h, w] instead of [w, h]
2, A spelling mistake, in which in yolo/utils/bounding_box_utils.py inside Anc2Box the update function updated the wrong variable: "self.anchor_grid" instead of "self.anchor_grids" as defined in Anc2Box.init().

The asserted Tensor shapes were wrong.
The number of anchors should be half in each row as in the columns for the updated resolution of (320, 640) [width, height].
@henrytsui000 henrytsui000 merged commit 959b9b0 into WongKinYiu:main Nov 7, 2024
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

Inconsistent expected image_size [width, height] / [height, width] order in code.
2 participants