def arr_from_img(im,shift=0.5):
    w,h=im.size
    arr=np.asarray(im.getdata(), dtype=theano.config.floatX)
    c = np.product(arr.size) / (w*h)
    return arr.reshape((h,w,c)).transpose(2,1,0) / 255. - shift

# loads params in npz (if filename is a .npz) or pickle if not
dataset/ETHPy150Open woshialex/diagnose-heart/CNN_A/utils.py/arr_from_img/original