Open LaCandela opened 2 years ago
Not the author, but spent an unreasonable amount of time reading through this function trying to understand it so gonna take a stab at an answer, at least regarding the aspect ratio check.
The aspect ratios are calculated from the gain-scaled targets and then filtered based on the anchor_t
hyperparameter. The default value is I think 4.0
which means any target which has an aspect ratio that is greater than 4.0 or less than 0.25 is ignored.
If I had to guess, this is for one of a few possible reasons:
The larger you set this value, the more tolerant of narrow bounding boxes your training cycle will become. Hopefully that was helpful at least a bit.
@jacoblubecki @LaCandela https://github.com/ultralytics/yolov5/issues/4158#issuecomment-886627065
Could you explain a bit how does the anchor box to ground truth box maching is performed in utils.loss.build_targets() ?
https://github.com/WongKinYiu/yolor/blob/be7da6eba2f612a15bf462951d3cdde66755a180/utils/loss.py#L152
It seems that somehow the aspect ratio is used but I don't understand how.
Thanks!