def METHOD_NAME(uri, cuda=False):
    img_transforms = transforms.Compose(
        [transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor()]
    )
    if (validators.url(uri)):
        img = Image.open(requests.get(uri, stream=True).raw)
    else:
        img = Image.open(uri)
    img = img_transforms(img)
    with torch.no_grad():
        # mean and std are not multiplied by 255 as they are in training script
        # torch dataloader reads data into bytes whereas loading directly
        # through PIL creates a tensor with floats in [0,1] range
        mean = torch.tensor([0.485, 0.456, 0.406]).view(1, 3, 1, 1)
        std = torch.tensor([0.229, 0.224, 0.225]).view(1, 3, 1, 1)
        img = img.float()
        if cuda:
            mean = mean.cuda()
            std = std.cuda()
            img = img.cuda()
        input = img.unsqueeze(0).sub_(mean).div_(std)
    return input