parameters: (roidb, voxelizer)
return_statement: return blobs
docstring: Given a roidb, construct a minibatch sampled from it.
docstring_summary: Given a roidb, construct a minibatch sampled from it.
docstring_tokens: Given a roidb construct a minibatch sampled from it .
function: def get_minibatch(roidb, voxelizer):
      """Given a roidb, construct a minibatch sampled from it."""
      num_images = len(roidb)
      assert(num_images % cfg.TRAIN.NUM_STEPS == 0), \
          'num_images ({}) must be dividable by NUM_STEPS ({})'. \
          format(num_images, cfg.TRAIN.NUM_STEPS)
  
      # Get the input image blob, formatted for tensorflow
      random_scale_ind = npr.randint(0, high=len(cfg.TRAIN.SCALES_BASE))
      im_blob, im_depth_blob, im_normal_blob, im_scales = _get_image_blob(roidb, random_scale_ind)
  
      # build the label blob
      depth_blob, label_blob, meta_data_blob, state_blob, weights_blob, points_blob = _get_label_blob(roidb, voxelizer)
  
      # reshape the blobs
      num_steps = cfg.TRAIN.NUM_STEPS
      ims_per_batch = cfg.TRAIN.IMS_PER_BATCH
  
      height = im_blob.shape[1]
      width = im_blob.shape[2]
      im_blob = im_blob.reshape((num_steps, ims_per_batch, height, width, -1))
      im_depth_blob = im_depth_blob.reshape((num_steps, ims_per_batch, height, width, -1))
      im_normal_blob = im_normal_blob.reshape((num_steps, ims_per_batch, height, width, -1))
  
      height = label_blob.shape[1]
      width = label_blob.shape[2]
      depth_blob = depth_blob.reshape((num_steps, ims_per_batch, height, width, -1))
      label_blob = label_blob.reshape((num_steps, ims_per_batch, height, width, -1))
      meta_data_blob = meta_data_blob.reshape((num_steps, ims_per_batch, 1, 1, -1))
  
      # For debug visualizations
      # _vis_minibatch(im_blob, im_depth_blob, depth_blob, label_blob)
  
      blobs = {'data_image_color': im_blob,
               'data_image_depth': im_depth_blob,
               'data_image_normal': im_normal_blob,
               'data_depth': depth_blob,
               'data_label': label_blob,
               'data_meta_data': meta_data_blob,
               'data_state': state_blob,
               'data_weights': weights_blob,
               'data_points': points_blob}
  
      return blobs
function_tokens: def get_minibatch ( roidb , voxelizer ) : num_images = len ( roidb ) assert ( num_images % cfg . TRAIN . NUM_STEPS == 0 ) , 'num_images ({}) must be dividable by NUM_STEPS ({})' . format ( num_images , cfg . TRAIN . NUM_STEPS ) # Get the input image blob, formatted for tensorflow random_scale_ind = npr . randint ( 0 , high = len ( cfg . TRAIN . SCALES_BASE ) ) im_blob , im_depth_blob , im_normal_blob , im_scales = _get_image_blob ( roidb , random_scale_ind ) # build the label blob depth_blob , label_blob , meta_data_blob , state_blob , weights_blob , points_blob = _get_label_blob ( roidb , voxelizer ) # reshape the blobs num_steps = cfg . TRAIN . NUM_STEPS ims_per_batch = cfg . TRAIN . IMS_PER_BATCH height = im_blob . shape [ 1 ] width = im_blob . shape [ 2 ] im_blob = im_blob . reshape ( ( num_steps , ims_per_batch , height , width , - 1 ) ) im_depth_blob = im_depth_blob . reshape ( ( num_steps , ims_per_batch , height , width , - 1 ) ) im_normal_blob = im_normal_blob . reshape ( ( num_steps , ims_per_batch , height , width , - 1 ) ) height = label_blob . shape [ 1 ] width = label_blob . shape [ 2 ] depth_blob = depth_blob . reshape ( ( num_steps , ims_per_batch , height , width , - 1 ) ) label_blob = label_blob . reshape ( ( num_steps , ims_per_batch , height , width , - 1 ) ) meta_data_blob = meta_data_blob . reshape ( ( num_steps , ims_per_batch , 1 , 1 , - 1 ) ) # For debug visualizations # _vis_minibatch(im_blob, im_depth_blob, depth_blob, label_blob) blobs = { 'data_image_color' : im_blob , 'data_image_depth' : im_depth_blob , 'data_image_normal' : im_normal_blob , 'data_depth' : depth_blob , 'data_label' : label_blob , 'data_meta_data' : meta_data_blob , 'data_state' : state_blob , 'data_weights' : weights_blob , 'data_points' : points_blob } return blobs