Gatys et al. style transfer implementation

As an exercise, i am trying to implement the Gatys et al. style transfer in fastaiV1. But there are some details that are tripping me up.

I started with the old course notebook:

But a lot of the syntax is completely unknown to me. SO i was pointed in the direction of a fastaiV2 implementation:

This is a lot more understandable to me. Although there are still some things I have problems implementing. The issue at hand is the function:

def get_style_im(url):
download_url(url, 'style.jpg')
fn = 'style.jpg'
dset = Datasets(fn, tfms=[PILImage.create])
dl = dset.dataloaders(after_item=[ToTensor()], after_batch=[IntToFloatTensor(), Normalize.from_stats(*imagenet_stats)], bs=1)
return dl.one_batch()[0]

From what I understand this takes an image and returns it as a batch. So how to i make a single image batch in fastaiV1?

My current solution is:

dl = DataLoader(style_img, batch_size=1)
db = DataBunch(dl, dl)
batch = db.one_batch

But in this way I am forced to give a validation set. And I cannot get ‘.normalize(imagenet_stats)’ to work on ‘db’. Is there a simple solution that I am missing?