def save_caffe_image(img, filename, autoscale=True, autoscale_center=None):
 if (len(img.shape) == 2):
  img = np.tile(img[:, :, np.newaxis], (1, 1, 3))
 else:
  img = img[::(-1)].transpose((1, 2, 0))
 if (autoscale_center is not None):
  img = norm01c(img, autoscale_center)
 elif autoscale:
  img = img.copy()
  img -= img.min()
  img *= (1.0 / (img.max() + 1e-10))
 skimage.io.imsave(filename, img)

def save_caffe_image ( img , filename , autoscale = True , autoscale_center = None ) : if ( len ( img . shape ) == 2 ) : img = np . tile ( img [ : , : , np . newaxis ] , ( 1 , 1 , 3 ) ) else : img = img [ : : ( - 1 ) ] . transpose ( ( 1 , 2 , 0 ) ) if ( autoscale_center is not None ) : img = norm01c ( img , autoscale_center ) elif autoscale : img = img . copy ( ) img -= img . min ( ) img *= ( 1.0 / ( img . max ( ) + 1e-10 ) ) skimage . io . imsave ( filename , img )
takes an image in caffe format or and saves it to a file .