Hi @shail ,
We would like to understand the significance of the **keep_aspect_ratio **setting in Luxonis Train:
How does it affect training when set to true vs false?
keep_aspect_ratio flag is esentially toggling letterbox resize (when set to true) vs stretch resize (when set to false). And this augmentation is always applied, on all train, val and test images.
In scenarios with a single object per frame, is it generally better to keep the aspect ratio or allow stretching?
As long as you are consistent between what the model is trained for and what the model gets as an input once deployed then this shouldn't have a big effect. Because if your model is trained on letterbox resized images and then your input once in DepthAI pipeline is stretched the features are obviously different and the model won't work as well.
The other consideration though is also about your original training dataset. If the dataset containes images with different aspect ratios then I would suggest you go with keep_aspect_ratio: True because if you do stretching same objects will look diferently and the model will have a harder time training (e.g. person stretched from vertical vs horizontal image looks differently).
Are there any best practices for maximizing confidence and detection accuracy related specifically to keep_aspect_ratio?
Other then the considerations listed above about being consistent throughout the whole pipeline (training+deployment) and thinking about what kind of images you have to start with I wouldn't say there are any additional points.
Only one minor comes to mind which is that we initialize weights with COCO pretrained weights and those were generated by training with keep_aspect_ration=True. So you might see that the model trains faster with the same settings on your case as well since the feature extraction is somewhat alligned to begin with. But with longer trainings the effect of this can be very miniscule.
Let me know if this answers your questions,
Klemen