Help: how to custom fastai datablock API for generating new data

Hello everyone,

I am dong object detection (RetinaNet) with a small digit dataset as shown below.
I would like to generate more data on the fly way. It means each time an image is loaded, the system will randomly replace another digit at the bounding box positions. But I really do not know how to code it with fastai data block API.
Can anyone please help with it.