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
This ensures that each pair of coordinates (rows) is checked together, filtering only those points that satisfy the conditions (coord >= 0 and coord <= 1) across both axes.
This fix preserves each pair of coordinates, but if a bounding box has points outside [0, 1], those points are filtered out. This can lead to incomplete bounding boxes composed only of the remaining points, which no longer meaningfully represent the original bounding box.
Expected behavior
I believe that unless all points lie entirely outside the [0, 1], we should preserve the bounding box by clipping any out-of-range coordinates to [0, 1]. This helps maintain as much of the original bounding box as possible. What are your thoughts?
Describe the bug
The
load_valid_labels()
function inyolo/tools/data_loader.py
currently filters coordinates element-wise, as shown below:Because some rows can be partially filtered out, this can disrupt the 2D structure of the coordinate pairs.
A more appropriate approach would be:
This ensures that each pair of coordinates (rows) is checked together, filtering only those points that satisfy the conditions (
coord >= 0
andcoord <= 1
) across both axes.To Reproduce
Consider the following points:
With the current logic:
With the suggested fix, the output would be:
This fix preserves each pair of coordinates, but if a bounding box has points outside
[0, 1]
, those points are filtered out. This can lead to incomplete bounding boxes composed only of the remaining points, which no longer meaningfully represent the original bounding box.Expected behavior
I believe that unless all points lie entirely outside the
[0, 1]
, we should preserve the bounding box by clipping any out-of-range coordinates to[0, 1]
. This helps maintain as much of the original bounding box as possible. What are your thoughts?Screenshots
Visualization bboxes of heads using the CrowdHuman dataset.
Current filtering logic:
![Image](https://private-user-images.githubusercontent.com/42567842/405329323-172557f7-118e-4ef6-807c-c729909d48c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTc5NDcsIm5iZiI6MTczODkxNzY0NywicGF0aCI6Ii80MjU2Nzg0Mi80MDUzMjkzMjMtMTcyNTU3ZjctMTE4ZS00ZWY2LTgwN2MtYzcyOTkwOWQ0OGM0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA4NDA0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg2NDhlZTNmZTc1MjBhMTZkYzNhMWQ2NGQ2OTkxMDEwZmU5NjEzYWYyMjFkNjQzOGYxZmQ0ZTdlYWY1ZDY4NWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kLCrsPtnlJLS-Xu4YUCE4khY-HSuE4VnSL8QyUQE5_k)
Fixed filtering logic:
![Image](https://private-user-images.githubusercontent.com/42567842/405329380-87122832-7f28-454f-bc57-5718143aca72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTc5NDcsIm5iZiI6MTczODkxNzY0NywicGF0aCI6Ii80MjU2Nzg0Mi80MDUzMjkzODAtODcxMjI4MzItN2YyOC00NTRmLWJjNTctNTcxODE0M2FjYTcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA4NDA0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRiNmVhMmVhMWQwNzg0Yjg4M2Q4ZTJlNjZlYmU1YzYxODk2M2I3MGVmOWVlMDhjNWNmZWY5Mzk0ODQwNDYzZGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yR0NAPdjx33Qkpc4LSC960ealiHCJzHNRJ6n-mqHwjA)
The text was updated successfully, but these errors were encountered: