code: def _rand_bboxes(num_boxes, h, w):
      cx, cy, bw, bh = torch.rand(num_boxes, 4).T
  
      tl_x = ((cx * w) - (w * bw / 2)).clamp(0, w).unsqueeze(0)
      tl_y = ((cy * h) - (h * bh / 2)).clamp(0, h).unsqueeze(0)
      br_x = ((cx * w) + (w * bw / 2)).clamp(0, w).unsqueeze(0)
      br_y = ((cy * h) + (h * bh / 2)).clamp(0, h).unsqueeze(0)
  
      bboxes = torch.cat([tl_x, tl_y, br_x, br_y], dim=0).T
      return bboxes
  
file_path: mmocr/tests/test_engine/test_hooks/test_visualization_hook.py
imports: import os.path
  import shutil
  import time
  from unittest import TestCase
  from unittest.mock import Mock
  import torch
  from mmengine.structures import InstanceData
  from mmocr.engine.hooks import VisualizationHook
  from mmocr.structures import TextDetDataSample
  from mmocr.visualization import TextDetLocalVisualizer
label_desc: Use image node_id 1 for calling a global function with example usage: _rand_bboxes(num_boxes, h, w) and returns: bboxes