code: def on_validation_epoch_end(self):
      val_result = self.validation_metric.compute()
      if self.use_loss:
          self.log_dict({"val_direct_loss": val_result}, sync_dist=True)
      else:
          # TODO: add mAP/mAR_per_class
          val_result.pop(
              "classes", None
          )  # introduced in torchmetrics v1.0.0
          mAPs = {"val_" + k: v for k, v in val_result.items()}
          mAPs["val_mAP"] = mAPs["val_map"]
          self.log_dict(mAPs, sync_dist=True)
      self.validation_metric.reset()
  
imports: import logging
  from typing import Callable, Optional, Union
  import lightning.pytorch
  import torchmetrics
  from lightning.pytorch.utilities import grad_norm
  from torch.nn.modules.loss import _Loss
  from torchmetrics.aggregation import BaseAggregator
  from ..constants import BBOX, IMAGE, LABEL
  from .utils import apply_layerwise_lr_decay, apply_single_lr, apply_two_stages_lr, get_lr_scheduler, get_optimizer, remove_parameters_without_grad
label_desc: Use image node_id 10 for calling the MMDetLitModule obj's underlying member method code with example usage: obj.on_validation_epoch_end() without return types