coco_dataset.py 466 B

1234567891011121314151617
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from typing import Any
  3. from mmengine.dataset import force_full_init
  4. from mmyolo.registry import DATASETS
  5. from mmpose.datasets import CocoDataset as MMPoseCocoDataset
  6. @DATASETS.register_module()
  7. class CocoDataset(MMPoseCocoDataset):
  8. @force_full_init
  9. def prepare_data(self, idx) -> Any:
  10. data_info = self.get_data_info(idx)
  11. data_info['dataset'] = self
  12. return self.pipeline(data_info)