(imgs)
return imgs
Subtract mean and normalize, imgs [N, 1, W, H]
Subtract mean and normalize, imgs [N, 1, W, H]
Subtract mean and normalize imgs [ N 1 W H ]
def processImage(imgs):
    '''
    Subtract mean and normalize, imgs [N, 1, W, H]
    '''
    imgs = imgs.astype(np.float32)
    for i, img in enumerate(imgs):
        m = img.mean()
        s = img.std()
        imgs[i] = (img-m)/s
    return imgs
def processImage ( imgs ) : imgs = imgs . astype ( np . float32 ) for i , img in enumerate ( imgs ) : m = img . mean ( ) s = img . std ( ) imgs [ i ] = ( img - m ) / s return imgs