parameters: (self, out_logits, out_bbox, target_sizes)
return_statement: return results
docstring: Perform the computation
          Parameters:
              out_logits and out_bbox: raw outputs of the model
              target_sizes: tensor of dimension [batch_size x 2] containing the size of each images of the batch
                            For evaluation, this must be the original image size (before any data augmentation)
                            For visualization, this should be the image size after data augment, but before padding
docstring_summary: Perform the computation
          Parameters:
              out_logits and out_bbox: raw outputs of the model
              target_sizes: tensor of dimension [batch_size x 2] containing the size of each images of the batch
                            For evaluation, this must be the original image size (before any data augmentation)
                            For visualization, this should be the image size after data augment, but before padding
docstring_tokens: Perform the computation Parameters : out_logits and out_bbox : raw outputs of the model target_sizes : tensor of dimension [ batch_size x 2 ] containing the size of each images of the batch For evaluation this must be the original image size ( before any data augmentation ) For visualization this should be the image size after data augment but before padding
function: def forward(self, out_logits, out_bbox, target_sizes):
          """ Perform the computation
          Parameters:
              out_logits and out_bbox: raw outputs of the model
              target_sizes: tensor of dimension [batch_size x 2] containing the size of each images of the batch
                            For evaluation, this must be the original image size (before any data augmentation)
                            For visualization, this should be the image size after data augment, but before padding
          """
          #assert len(out_logits) == len(target_sizes)
          #assert target_sizes.shape[1] == 2
  
          prob = self.softmax(out_logits)
          scores, labels = prob[..., :-1].max(-1)
  
          # convert to [x0, y0, x1, y1] format
          boxes = self.box_cxcywh_to_xyxy(out_bbox).cpu()
          # and from relative [0, 1] to absolute [0, height] coordinates
          img_h, img_w = target_sizes.unbind(1)
          scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1)
          boxes = boxes * scale_fct[:, None, :]
          results = [{'scores': s, 'labels': l, 'boxes': b} for s, l, b in zip(scores, labels, boxes)]
          return results
function_tokens: def forward ( self , out_logits , out_bbox , target_sizes ) : #assert len(out_logits) == len(target_sizes) #assert target_sizes.shape[1] == 2 prob = self . softmax ( out_logits ) scores , labels = prob [ ... , : - 1 ] . max ( - 1 ) # convert to [x0, y0, x1, y1] format boxes = self . box_cxcywh_to_xyxy ( out_bbox ) . cpu ( ) # and from relative [0, 1] to absolute [0, height] coordinates img_h , img_w = target_sizes . unbind ( 1 ) scale_fct = torch . stack ( [ img_w , img_h , img_w , img_h ] , dim = 1 ) boxes = boxes * scale_fct [ : , None , : ] results = [ { 'scores' : s , 'labels' : l , 'boxes' : b } for s , l , b in zip ( scores , labels , boxes ) ] return results