mmclassification 里面读取数据id的code在哪个函数
时间: 2023-12-21 21:07:43 浏览: 75
scanf ()函数- 读取数据.pdf
在 mmcls/datasets/pipelines/formatting.py 文件中的 DefaultFormatBundle 类的 __call__ 函数中可以找到读取数据 id 的代码。具体来说,该函数会将数据按照指定的格式进行打包,其中包括数据 id,代码如下:
```
results['img_metas'] = img_metas
results['gt_labels'] = gt_labels
results['proposals'] = proposals
if 'bbox_fields' in self.keep:
results['bbox_fields'] = bbox_fields
if 'mask_fields' in self.keep:
results['mask_fields'] = mask_fields
if 'seg_fields' in self.keep:
results['seg_fields'] = seg_fields
if 'keypoint_fields' in self.keep:
results['keypoint_fields'] = keypoint_fields
if 'id' in data:
results['id'] = data['id']
```
阅读全文