def img_transform(img_rgb, transform=None):
    """
    convert image from rgb to transformed tensor
    :param img_rgb: PIL Image
    :param transform: torchvision.transform
    :return: tensor
    """

    if transform is None:
        raise ValueError("There is no transform！Please add necessary transform methods")

    img_t = transform(img_rgb)
    return img_t