learnergy/visual/image.py
def create_rgb_mosaic(tensor, n_samples=1):
    """Creates a squared mosaic for RGB images.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.
        n_samples (int): The amount of samples to be plotted (width or height).

    """

    # Permutes the tensor and transforms into numpy-based array
    array = tensor.detach().permute(0, 2, 3, 1).numpy()

    # plot images from the dataset
    for i in range(n_samples * n_samples):
        # Creates the subplots
        plt.subplot(n_samples, n_samples, 1 + i)

        # Removes the axis
        plt.axis('off')

        # Plots the raw data
        plt.imshow(array[i])

    # Shows the plot
    plt.show()
Creates a squared mosaic for RGB images.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.
        n_samples (int): The amount of samples to be plotted (width or height).

    
Creates a squared mosaic for RGB images.
Creates a squared mosaic for RGB images .
def create_rgb_mosaic(tensor, n_samples=1):
    array = tensor.detach().permute(0, 2, 3, 1).numpy()
    for i in range(n_samples * n_samples):
        plt.subplot(n_samples, n_samples, 1 + i)
        plt.axis('off')
        plt.imshow(array[i])
    plt.show()
def create_rgb_mosaic ( tensor , n_samples = 1 ) : array = tensor . detach ( ) . permute ( 0 , 2 , 3 , 1 ) . numpy ( ) for i in range ( n_samples * n_samples ) : plt . subplot ( n_samples , n_samples , 1 + i ) plt . axis ( 'off' ) plt . imshow ( array [ i ] ) plt . show ( )
Creates a squared mosaic for RGB images.
Creates a squared mosaic for RGB images .
"""Creates a squared mosaic for RGB images.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.
        n_samples (int): The amount of samples to be plotted (width or height).

    """ # Permutes the tensor and transforms into numpy-based array # plot images from the dataset # Creates the subplots # Removes the axis # Plots the raw data # Shows the plot
tensor
An input tensor to have its mosaic created.
An input tensor to have its mosaic created .
n_samples
The amount of samples to be plotted (width or height).
The amount of samples to be plotted ( width or height ) .