original_docstring:  Prep opencv 3 channel image for the network 
docstring: Prep opencv 3 channel image for the network
docstring_tokens: Prep opencv 3 channel image for the network
code: def transform_img(im):
      ''' Prep opencv 3 channel image for the network '''
      im_orig = im.astype(np.float32, copy=True)
      im_orig -= np.array([[[103.1, 115.9, 123.2]]]) # BGR pixel mean
      blob = np.zeros((1, im.shape[0], im.shape[1], 3), dtype=np.float32)
      blob[0, :, :, :] = im_orig
      blob = blob.transpose((0, 3, 1, 2))
      return blob
code_tokens: def transform_img ( im ) : im_orig = im . astype ( np . float32 , copy = True ) im_orig -= np . array ( [ [ [ 103.1 , 115.9 , 123.2 ] ] ] ) blob = np . zeros ( ( 1 , im . shape [ 0 ] , im . shape [ 1 ] , 3 ) , dtype = np . float32 ) blob [ 0 , : , : , : ] = im_orig blob = blob . transpose ( ( 0 , 3 , 1 , 2 ) ) return blob
short_docstring: Prep opencv 3 channel image for the network
short_docstring_tokens: Prep opencv 3 channel image for the network
comment: ''' Prep opencv 3 channel image for the network '''$SEP$# BGR pixel mean