You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far the expected way, in which one provided the image_size in general.config was in [width, height] order, as all the code in the implementation was expecting it to be provided that way. In the recent changes in commit main@aba5422 with the title "[Add] dynamic image size loader" however, Line 125 in yolo/utils/bounding_box_utils.py got changed from:
W, H = image_size to H, W = image_size in the generate_anchors function.
In the entire input pipeline however, including the dataloader and data_augmentation, the order is still expected to be in [width, height]. This leads to the bug, when using a non-quadratic image_size, that the input image and the generated anchors (used during training in the loss function and in post-processing during inference) do not match, yielding incorrect results.
Check the resulting detections in runs/inference/v9-dev/frame000.png
Screenshots
Current state:
If I change H, W = image_size back to W, H = image_size at Line125 in yolo/utils/bounding_box_utils.py:
Expected behavior
Consistent handling of provided non-quadratic image_size.
My Recommendation
Revert Line 125 in yolo/utils/bounding_box_utils.py back to W, H = image_size to solve the issue and keep consistent with the up to this point used [width, height] order definition in config.yaml, as changing everything to [height, width] at this point would require a lot more work.
Change the default image_size in config.yaml and in all the tests to some non-quadratic resolution, so that in the future such bugs do not go unnoticed before merging to main (the default is [640, 640] now, with which everything works properly of course)
The text was updated successfully, but these errors were encountered:
Describe the bug
So far the expected way, in which one provided the image_size in general.config was in [width, height] order, as all the code in the implementation was expecting it to be provided that way. In the recent changes in commit main@aba5422 with the title "[Add] dynamic image size loader" however, Line 125 in yolo/utils/bounding_box_utils.py got changed from:
W, H = image_size
toH, W = image_size
in the generate_anchors function.In the entire input pipeline however, including the dataloader and data_augmentation, the order is still expected to be in [width, height]. This leads to the bug, when using a non-quadratic image_size, that the input image and the generated anchors (used during training in the loss function and in post-processing during inference) do not match, yielding incorrect results.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Current state:
If I change
H, W = image_size
back toW, H = image_size
at Line125 in yolo/utils/bounding_box_utils.py:Expected behavior
Consistent handling of provided non-quadratic image_size.
My Recommendation
W, H = image_size
to solve the issue and keep consistent with the up to this point used [width, height] order definition in config.yaml, as changing everything to [height, width] at this point would require a lot more work.The text was updated successfully, but these errors were encountered: