original_docstring:  Scales, crops, and normalizes a PIL image for a PyTorch model,
          returns an Numpy array
      
docstring: Scales, crops, and normalizes a PIL image for a PyTorch model,
  returns an Numpy array
docstring_tokens: Scales crops and normalizes a PIL image for a PyTorch model returns an Numpy array
code: def process_image(image_path):
      ''' Scales, crops, and normalizes a PIL image for a PyTorch model,
          returns an Numpy array
      '''
      im = Image.open(image_path)
   
      # Resize the image
      im.thumbnail((256, 256), Image.ANTIALIAS)
      
      # Crop out the center 224x224 portion of the image
      width, height = im.size 
      new_width, new_height = 224, 224
      left = (width - new_width)/2
      top = (height - new_height)/2
      right = (width + new_width)/2
      bottom = (height + new_height)/2
      im = im.crop((left, top, right, bottom))    
      
      # Convert image to numpy array
      np_image = np.array(im)/255
      
      # Normalize the image
      mean = np.array([0.485, 0.456, 0.406])
      std = np.array([0.229, 0.224, 0.225])
      np_image = (np_image - mean) / std
      
      return np_image.transpose((2,0,1))
code_tokens: def process_image ( image_path ) : im = Image . open ( image_path ) im . thumbnail ( ( 256 , 256 ) , Image . ANTIALIAS ) width , height = im . size new_width , new_height = 224 , 224 left = ( width - new_width ) / 2 top = ( height - new_height ) / 2 right = ( width + new_width ) / 2 bottom = ( height + new_height ) / 2 im = im . crop ( ( left , top , right , bottom ) ) np_image = np . array ( im ) / 255 mean = np . array ( [ 0.485 , 0.456 , 0.406 ] ) std = np . array ( [ 0.229 , 0.224 , 0.225 ] ) np_image = ( np_image - mean ) / std return np_image . transpose ( ( 2 , 0 , 1 ) )
short_docstring: Scales, crops, and normalizes a PIL image for a PyTorch model,
  returns an Numpy array
short_docstring_tokens: Scales crops and normalizes a PIL image for a PyTorch model returns an Numpy array
comment: ''' Scales, crops, and normalizes a PIL image for a PyTorch model,
          returns an Numpy array
      '''$SEP$# Resize the image$SEP$# Crop out the center 224x224 portion of the image$SEP$# Convert image to numpy array$SEP$# Normalize the image