ravens/agents/transporter.py
def visualize_images(self, p0, p0_theta, p1, p1_theta, original_pixels,
            colormap, heightmap, colormap_g, heightmap_g, input_image, before_aug):
        """Daniel: code to debug and visualuze the image (including perturbed).

        The height maps will not be grayscale because of matplotlib's color
        scheme, I think. Using cv2.imwrite(..., heightmap) shows grayscale.
        """
        print(f'\nForward pass.')
        p0_theta_d = (180 / np.pi) * p0_theta
        p1_theta_d = (180 / np.pi) * p1_theta
        heightmap = heightmap / np.max(heightmap) * 255
        heightmap_g = heightmap_g / np.max(heightmap_g) * 255

        plt.subplots(1, 6, figsize=(12,4))
        plt.subplot(1,6,1)
        plt.imshow(colormap)
        plt.subplot(1,6,2)
        plt.imshow(heightmap)
        plt.subplot(1,6,3)
        plt.imshow(colormap_g)
        plt.subplot(1,6,4)
        plt.imshow(heightmap_g)
        plt.subplot(1,6,5)
        plt.imshow(np.array(input_image[:,:,0:3]).astype(np.uint8))
        plt.subplot(1,6,6)
        plt.imshow(np.array(input_image[:,:,6:9]).astype(np.uint8))

        op_0, op_1 = original_pixels
        title = f'Before Data Aug: ' \
                f'Pick: ({op_0}, {p0_theta:0.2f}) ' \
                f'Place: ({op_1}, {p1_theta:0.2f}={p1_theta_d:0.2f})\n' \
                f'After Data Aug: ' \
                f'Pick: ({p0}) ' \
                f'Place: ({p1})'
        plt.suptitle(title, fontsize=15)
        plt.tight_layout()
        plt.show()
Daniel: code to debug and visualuze the image (including perturbed).

        The height maps will not be grayscale because of matplotlib's color
        scheme, I think. Using cv2.imwrite(..., heightmap) shows grayscale.
        
code to debug and visualuze the image (including perturbed).
The height maps will not be grayscale because of matplotlib's color
scheme, I think. Using cv2.imwrite(..., heightmap) shows grayscale.
code to debug and visualuze the image ( including perturbed ) . The height maps will not be grayscale because of matplotlib ' s color scheme I think . Using cv2 . imwrite ( ... heightmap ) shows grayscale .
def visualize_images(self, p0, p0_theta, p1, p1_theta, original_pixels,
            colormap, heightmap, colormap_g, heightmap_g, input_image, before_aug):
        print(f'\nForward pass.')
        p0_theta_d = (180 / np.pi) * p0_theta
        p1_theta_d = (180 / np.pi) * p1_theta
        heightmap = heightmap / np.max(heightmap) * 255
        heightmap_g = heightmap_g / np.max(heightmap_g) * 255
        plt.subplots(1, 6, figsize=(12,4))
        plt.subplot(1,6,1)
        plt.imshow(colormap)
        plt.subplot(1,6,2)
        plt.imshow(heightmap)
        plt.subplot(1,6,3)
        plt.imshow(colormap_g)
        plt.subplot(1,6,4)
        plt.imshow(heightmap_g)
        plt.subplot(1,6,5)
        plt.imshow(np.array(input_image[:,:,0:3]).astype(np.uint8))
        plt.subplot(1,6,6)
        plt.imshow(np.array(input_image[:,:,6:9]).astype(np.uint8))
        op_0, op_1 = original_pixels
        title = f'Before Data Aug: ' \
                f'Pick: ({op_0}, {p0_theta:0.2f}) ' \
                f'Place: ({op_1}, {p1_theta:0.2f}={p1_theta_d:0.2f})\n' \
                f'After Data Aug: ' \
                f'Pick: ({p0}) ' \
                f'Place: ({p1})'
        plt.suptitle(title, fontsize=15)
        plt.tight_layout()
        plt.show()
def visualize_images ( self , p0 , p0_theta , p1 , p1_theta , original_pixels , colormap , heightmap , colormap_g , heightmap_g , input_image , before_aug ) : print ( f'\nForward pass.' ) p0_theta_d = ( 180 / np . pi ) * p0_theta p1_theta_d = ( 180 / np . pi ) * p1_theta heightmap = heightmap / np . max ( heightmap ) * 255 heightmap_g = heightmap_g / np . max ( heightmap_g ) * 255 plt . subplots ( 1 , 6 , figsize = ( 12 , 4 ) ) plt . subplot ( 1 , 6 , 1 ) plt . imshow ( colormap ) plt . subplot ( 1 , 6 , 2 ) plt . imshow ( heightmap ) plt . subplot ( 1 , 6 , 3 ) plt . imshow ( colormap_g ) plt . subplot ( 1 , 6 , 4 ) plt . imshow ( heightmap_g ) plt . subplot ( 1 , 6 , 5 ) plt . imshow ( np . array ( input_image [ : , : , 0 : 3 ] ) . astype ( np . uint8 ) ) plt . subplot ( 1 , 6 , 6 ) plt . imshow ( np . array ( input_image [ : , : , 6 : 9 ] ) . astype ( np . uint8 ) ) op_0 , op_1 = original_pixels title = f'Before Data Aug: ' f'Pick: ({op_0}, {p0_theta:0.2f}) ' f'Place: ({op_1}, {p1_theta:0.2f}={p1_theta_d:0.2f})\n' f'After Data Aug: ' f'Pick: ({p0}) ' f'Place: ({p1})' plt . suptitle ( title , fontsize = 15 ) plt . tight_layout ( ) plt . show ( )
Daniel: code to debug and visualuze the image (including perturbed).
Daniel : code to debug and visualuze the image ( including perturbed ) .
"""Daniel: code to debug and visualuze the image (including perturbed).

        The height maps will not be grayscale because of matplotlib's color
        scheme, I think. Using cv2.imwrite(..., heightmap) shows grayscale.
        """
self
p0
p0_theta
p1
p1_theta
original_pixels
colormap
heightmap
colormap_g
heightmap_g
input_image
before_aug