(img)
return img
Preprocessing step before feeding the network.

    Arguments:
        img: a float numpy array of shape [h, w, c].

    Returns:
        a float numpy array of shape [1, c, h, w].
Preprocessing step before feeding the network.
Preprocessing step before feeding the network .
def _preprocess(img):
    """Preprocessing step before feeding the network.

    Arguments:
        img: a float numpy array of shape [h, w, c].

    Returns:
        a float numpy array of shape [1, c, h, w].
    """
    img = img.transpose((2, 0, 1))
    img = np.expand_dims(img, 0)
    img = (img - 127.5)*0.0078125
    return img
def _preprocess ( img ) : img = img . transpose ( ( 2 , 0 , 1 ) ) img = np . expand_dims ( img , 0 ) img = ( img - 127.5 ) * 0.0078125 return img