code: def test_base_frame_sample(self):
      sampler = BaseFrameSample()
      results = sampler(self.video_infos)
      assert isinstance(results, dict)
      for key in self.info_keys:
          assert key in results
          assert len(results[key]) == 1
          if key == "frame_id":
              assert results[key] == [4]
  
      key_frame_id = self.video_infos["key_frame_id"]
      assert (
          results["img"][0]
          == np.zeros((self.H, self.W, 3)) + key_frame_id
      ).all()
      assert (
          results["gt_bboxes"][0] == np.zeros((2, 4)) + key_frame_id
      ).all()
      assert (
          results["gt_bboxes_labels"][0]
          == np.zeros((2,)) + key_frame_id
      ).all()
      assert (
          results["gt_instances_id"][0] == np.zeros((2,)) + key_frame_id
      ).all()
      assert results["ori_shape"][0] == (
          self.H + key_frame_id,
          self.W + key_frame_id,
      )
      assert results["img_id"][0] == key_frame_id
  
file_path: mmdetection/tests/test_datasets/test_transforms/test_frame_sampling.py
imports: import unittest
  import numpy
  from mmdet.datasets.transforms import BaseFrameSample, UniformRefFrameSample
label_desc: Use image node_id 2 for calling the TestFrameSample obj's underlying member method code with example usage: obj.test_base_frame_sample() without return types