-
Notifications
You must be signed in to change notification settings - Fork 49
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
Simplify gen_txt.py #12
Comments
Do you require this parameter to filter small objects? Or can we calculate the size of objects independent of network input size? |
Yes. By filtering out objects that are too small, we would be asking the yolo model to learn more realistic targets. It would produce a object detector that performs better at inference time. (Don't just believe my words. You could experiment/verify it by yourself.) |
Hi, I totally agree with you regarding the performance improvements. However, by replacing the height/width with relative targets you can omit the input dimensions of the network and prepare the dataset only once for all input resolutions, which is more convenient for MLOps pipelines. MIN_W = 0.01
MIN_H = 0.01
#
w_rescaled = float(w) / img_w
h_rescaled = float(h) / img_h
if w_rescaled < MIN_W or h_rescaled < MIN_H:
return '' 0.01 times 608 is roughly 6 and 0.01 times 416 is 4, so you get about the same result for both common yolov4 configurations without having to know the input dimensions in advance. This change is very opinionated of course. I was including this in my automated data preparation workflow and wanted to share it with you in case you will automate this repo in the future. Considering it closed. |
I believe gen_txt.py is doing too much work. It should not be necessary to process the dataset for different input resolutions of the network, as the yolo input coordinates are basically UV coordinates and are relative to input image dimensions. (Unless you do letterbox rescaling I guess...)
AlexeyAB/Yolo_mark#60 (comment)
Current implementation:
Implementation from https://github.com/theAIGuysCode/OIDv4_ToolKit:
Note the lack of INPUT_WIDTH and INPUT_HEIGHT.
The text was updated successfully, but these errors were encountered: