Implementation question: Transforms from function

Hello!

I am working on image classification dataset and in order to increase accuracy, I have annotated images with bounding boxes (most of the images contain <25% area with object and all other is background). Now I have annotations with class, images size and bbox coordinates (only one per image).
I would like to create custom transform, similar to label from_name_func that will apply crop transform before all other augmentations.
The reason I want to use fastai pipeline and not crop images into separate files is that I want to keep best quality and apply all transforms altogether.

Will it be fast enough to use augmentation function per file name, or there are better ways to achieve this?

Will be happy to contribute new function with little guidance how to implement it.