src/utils.py
def merge(images, size):
    """
    merge image sequence (backward + forward)
    Args:
        images (numpy.ndarray): the array of images (backward + forward sequences),  shape (2*T, 80, 80, 3)
        size (list): (2,1), example value: [2,T]

    Returns:

    """
    h, w = images.shape[1], images.shape[2]
    img = np.zeros((h * size[0], w * size[1], 3))

    for idx, image in enumerate(images):
        print(idx, np.shape(image))
        i = idx % size[1]
        j = idx // size[1]
        img[j * h:j * h + h, i * w:i * w + w, :] = image

    return img

    merge image sequence (backward + forward)
    Args:
        images (numpy.ndarray): the array of images (backward + forward sequences),  shape (2*T, 80, 80, 3)
        size (list): (2,1), example value: [2,T]

    Returns:

    
merge image sequence (backward + forward)
merge image sequence ( backward + forward )
def merge(images, size):
    h, w = images.shape[1], images.shape[2]
    img = np.zeros((h * size[0], w * size[1], 3))
    for idx, image in enumerate(images):
        print(idx, np.shape(image))
        i = idx % size[1]
        j = idx // size[1]
        img[j * h:j * h + h, i * w:i * w + w, :] = image
    return img
def merge ( images , size ) : h , w = images . shape [ 1 ] , images . shape [ 2 ] img = np . zeros ( ( h * size [ 0 ] , w * size [ 1 ] , 3 ) ) for idx , image in enumerate ( images ) : print ( idx , np . shape ( image ) ) i = idx % size [ 1 ] j = idx // size [ 1 ] img [ j * h : j * h + h , i * w : i * w + w , : ] = image return img
merge image sequence (backward + forward)
merge image sequence ( backward + forward )
"""
    merge image sequence (backward + forward)
    Args:
        images (numpy.ndarray): the array of images (backward + forward sequences),  shape (2*T, 80, 80, 3)
        size (list): (2,1), example value: [2,T]

    Returns:

    """
None
images
the array of images (backward + forward sequences),  shape (2*T, 80, 80, 3)
the array of images ( backward + forward sequences ) shape ( 2 * T 80 80 3 )
size
None