img = Image.open(image_path).convert('RGB') img = transform(img) img = img.unsqueeze(0) # Add batch dimension