Thank you for the confirmation. While trying to implement it I run to a problem. This shades_of_gray method has an image as an argument:
def shades_of_gray(img, power=6, extra=None):
    
    # Parameters
    # ----------
    # img: 2D numpy array
    #   The original image with format of (h, w, c)
    # power: int
    #   The degree of norm, 6 is used in reference paper
    
    img_dtype = img.dtype

    img = img.astype('float32')
    img_power = numpy.power(img, power)
    rgb_vec = numpy.power(numpy.mean(img_power, (0,1)), 1/power)
    rgb_norm = numpy.power(numpy.sum(numpy.power(rgb_vec, extra)),1/extra)
    rgb_vec = rgb_vec/rgb_norm
    rgb_vec = 1/(rgb_vec*numpy.sqrt(3))
    img = numpy.multiply(img, rgb_vec)

    return img.astype(img_dtype)

Thus when make the transform.Compose I get: TypeError shades_of_gray() missing 1 required positional argument: img.
I suppose the error is not tricky to solve but I can’t figure out what it is. From your link I suspect that I should make a class with call and repr methods but I don’t fully understand how I should do that.
Thank you for your time.