class_docstr: Implementation of `End-to-End Semi-Supervised Object Detection
  with Soft Teacher <https://arxiv.org/abs/2106.09018>`_
  
  Args:
      detector (:obj:`ConfigDict` or dict): The detector config.
      semi_train_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised training config.
      semi_test_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised testing config.
      data_preprocessor (:obj:`ConfigDict` or dict, optional): Config of
          :class:`DetDataPreprocessor` to process the input data.
          Defaults to None.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
          list[dict], optional): Initialization config dict.
          Defaults to None.
docstr: Augment bboxes with jitter.
docstr_tok: ["Augment","bboxes","with","jitter","."]
code: def aug_box(batch_data_samples, times, frac):
      """Augment bboxes with jitter."""
  
      def _aug_single(box):
          box_scale = box[:, 2:4] - box[:, :2]
          box_scale = (
              box_scale.clamp(min=1)[:, None, :]
              .expand(-1, 2, 2)
              .reshape(-1, 4)
          )
          aug_scale = box_scale * frac  # [n,4]
  
          offset = (
              torch.randn(times, box.shape[0], 4, device=box.device)
              * aug_scale[None, ...]
          )
          new_box = (
              box.clone()[None, ...].expand(times, box.shape[0], -1)
              + offset
          )
          return new_box
  
      return [
          _aug_single(data_samples.gt_instances.bboxes)
          for data_samples in batch_data_samples
      ]
  
imports: import copy
  from typing import List, Optional, Tuple
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.utils import filter_gt_instances, rename_loss_dict, reweight_loss_dict
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, bbox_project
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptMultiConfig
  from ..utils.misc import unpack_gt_instances
  from .semi_base import SemiBaseDetector
label_desc: Use image node_id 8 for calling the SoftTeacher obj's underlying member method code with example usage: obj.aug_box(batch_data_samples, times, frac) and returns: unknown, new_box