Hi,
The issue comes from the [None] I think. You change this line to first convert to a Tensor then .unsqueeze(0) to get the exact same result:
img_inp = torch.tensor(prepare_img(img).transpose(2, 0, 1)).float().unsqueeze(0)