generation/util/util.py [64:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if isinstance(image_tensor, list):
        image_numpy = []
        for i in range(len(image_tensor)):
            image_numpy.append(tensor2im(image_tensor[i], imtype, normalize))
        return image_numpy
    image_numpy = image_tensor.cpu().float().numpy()
    if normalize:
        # print(np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,0]), np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,1]), np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,2]))
        image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + 1) / 2.0 * 255.0
    else:
        # print('without normalize', np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,0]), np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,1]), np.max(np.transpose(image_numpy, (1, 2, 0))[:,:,2]))
        image_numpy = np.transpose(image_numpy, (1, 2, 0)) * 255.0
        # image_numpy = np.transpose(image_numpy, (1, 2, 0))
    image_numpy = np.clip(image_numpy, 0, 255)
    if image_numpy.shape[2] == 1 or image_numpy.shape[2] > 3:
        image_numpy = image_numpy[:,:,0]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



separate_vae/util/util.py [24:36]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if isinstance(image_tensor, list):
        image_numpy = []
        for i in range(len(image_tensor)):
            image_numpy.append(tensor2im(image_tensor[i], imtype, normalize))
        return image_numpy
    image_numpy = image_tensor.cpu().float().numpy()
    if normalize:
        image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + 1) / 2.0 * 255.0
    else:
        image_numpy = np.transpose(image_numpy, (1, 2, 0)) * 255.0
    image_numpy = np.clip(image_numpy, 0, 255)
    if image_numpy.shape[2] == 1 or image_numpy.shape[2] > 3:
        image_numpy = image_numpy[:,:,0]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



