PackClsInputs¶
- class mmcls.datasets.transforms.PackClsInputs(meta_keys=('sample_idx', 'img_path', 'ori_shape', 'img_shape', 'scale_factor', 'flip', 'flip_direction'))[源代码]¶
将输入数据整理成为用于分类任务的数据格式。
Required Keys:
img
gt_label (optional)
*meta_keys(optional)
Deleted Keys:
All keys in the dict.
Added Keys:
inputs (
torch.Tensor): The forward data of models.data_samples (
ClsDataSample): The annotation info of the sample.
- 参数
meta_keys (Sequence[str]) –
The meta keys to be saved in the
metainfoof the packeddata_samples. Defaults to a tuple includes keys:sample_idx: The id of the image sample.img_path: The path to the image file.ori_shape: The original shape of the image as a tuple (H, W).img_shape: The shape of the image after the pipeline as a tuple (H, W).scale_factor: The scale factor between the resized image and the original image.flip: A boolean indicating if image flip transform was used.flip_direction: The flipping direction.