Use custom Pytorch dataset with fastai learner

My dataset is a set of images. The labels of the image are 2 coordinates (center of bounding boxes). I created a custom Pytorch dataset as shown in image.

I trained using pytorch and my results are not satisfactory and wanted compare results with using fastai training techniques.

I tried creating a databunch for the learner using this way

Even though the y_function is returning a numpy array, the databunch is reading it as a multi category list. I wanted to create a custom loss function and metric, but i need the labels to be a array.

Other option would be to somehow use the custom dataset and dataloader and create a databunch from this, but i cannot find sources to point me towards that.

Thanks for helping