parameters: (self)
return_statement: return self.transformer.preprocess(im, seg, depth, surface, contour)
docstring: Load the next image in a batch.
docstring_summary: Load the next image in a batch.
docstring_tokens: Load the next image in a batch .
function: def load_next_sample(self):
          """
          Load the next image in a batch.
          """
          # Did we finish an epoch?
          if self._cur == len(self.list_samples):
              self._cur = 0
              shuffle(self.list_samples)
  
          # Load rgb and its different types of gt from one sample
          index = self.indexlist[self._cur]  # Get the sample index
          image_file_name = list_samples[index][0];
          seg_file_name = list_samples[index][1];
          depth_file_name = list_samples[index][2];
          surface_file_name = list_samples[index][3];
          contour_file_name = list_samples[index][4];
          
          img = cv2.imread(image_file_name, 1);
          seg = cv2.imread(seg_file_name, 0);
          depth = cv2.imread(depth_file_name, -1);
          surface = cv2.imread(surface_file_name, -1);
          contour = cv2.imread(contour_file_name, 0);
  
          # do a simple horizontal flip as data augmentation       
          if self.mirror == True:
              flip = np.random.choice(2)*2-1
              im = im[:, ::flip, :]
              seg = seg[:, ::flip, :]
              depth = depth[:, ::flip, :]
              surface = surface[:, ::flip, :]
              contour = contour[:, ::flip, :]
          
          # randomly pick a scale from scale factors
          scale_num = len(self.scale_factors)
          self.scale = self.scale_factors[np.random.choice(scale_num)]
  
          self._cur += 1
          return self.transformer.preprocess(im, seg, depth, surface, contour)
function_tokens: def load_next_sample ( self ) : # Did we finish an epoch? if self . _cur == len ( self . list_samples ) : self . _cur = 0 shuffle ( self . list_samples ) # Load rgb and its different types of gt from one sample index = self . indexlist [ self . _cur ] # Get the sample index image_file_name = list_samples [ index ] [ 0 ] seg_file_name = list_samples [ index ] [ 1 ] depth_file_name = list_samples [ index ] [ 2 ] surface_file_name = list_samples [ index ] [ 3 ] contour_file_name = list_samples [ index ] [ 4 ] img = cv2 . imread ( image_file_name , 1 ) seg = cv2 . imread ( seg_file_name , 0 ) depth = cv2 . imread ( depth_file_name , - 1 ) surface = cv2 . imread ( surface_file_name , - 1 ) contour = cv2 . imread ( contour_file_name , 0 ) # do a simple horizontal flip as data augmentation        if self . mirror == True : flip = np . random . choice ( 2 ) * 2 - 1 im = im [ : , : : flip , : ] seg = seg [ : , : : flip , : ] depth = depth [ : , : : flip , : ] surface = surface [ : , : : flip , : ] contour = contour [ : , : : flip , : ] # randomly pick a scale from scale factors scale_num = len ( self . scale_factors ) self . scale = self . scale_factors [ np . random . choice ( scale_num ) ] self . _cur += 1 return self . transformer . preprocess ( im , seg , depth , surface , contour )