def METHOD_NAME(self, logits, targets):
    # preds: Tensor(B, N, 5)
    preds = self.model.logits_to_preds(logits)
    # preds: Tensor(N, 6) as x1,y1,x2,y2,score,batch_idx
    preds = self.model._postprocess(preds)
    target_boxes = [target["target_boxes"] for target in targets]
    pred_boxes = [preds[preds[:, 5] == batch_idx, :5] for batch_idx in range(len(targets))]
    for metric in self.val_metrics.values():
        metric.update(pred_boxes, target_boxes)