PackClsInputs¶
- class mmcls.datasets.transforms.PackClsInputs(meta_keys=('sample_idx', 'img_path', 'ori_shape', 'img_shape', 'scale_factor', 'flip', 'flip_direction'))[source]¶
Pack the inputs data for the classification.
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.
- Parameters
meta_keys (Sequence[str]) –
The meta keys to be saved in the
metainfo
of 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.