(frames)
return new_frames
Convert frames from int8 [0, 255] to float32 [-1, 1].

    @param frames: A numpy array. The frames to be converted.

    @return: The normalized frames.
Convert frames from int8 [0, 255] to float32 [-1, 1].
Convert frames from int8 [ 0 255 ] to float32 [ - 1 1 ] .
def normalize_frames(frames):
    """
    Convert frames from int8 [0, 255] to float32 [-1, 1].

    @param frames: A numpy array. The frames to be converted.

    @return: The normalized frames.
    """
    new_frames = frames.astype(np.float32)
    new_frames /= (255 / 2)
    new_frames -= 1

    return new_frames
def normalize_frames ( frames ) : new_frames = frames . astype ( np . float32 ) new_frames /= ( 255 / 2 ) new_frames -= 1 return new_frames