mmaction2 icon indicating copy to clipboard operation
mmaction2 copied to clipboard

[Feature] Rename the confusing argument 'format_shape' in ActionDataPreprocessor

Open makecent opened this issue 2 years ago • 0 comments

What is the problem this feature will solve?

The argument name format_shape in ActionDataPreprocessor can be misleading: https://github.com/open-mmlab/mmaction2/blob/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/models/data_preprocessors/data_preprocessor.py#L30-L37

This name is identical to Transforms.FormatShape: https://github.com/open-mmlab/mmaction2/blob/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/datasets/transforms/formatting.py#L200-L204

However, the context and function of these two are distinctly different. The Transforms.FormatShape is aptly named as it actively formats the shape of data. In contrast, ActionDataPreprocessor.format_shape is essentially a descriptor indicating the required shape format (i.e., 'NCHW') for the data to be correctly processed by the preprocessor.

What is the feature?

  • (Option 1) A more descriptive name than ActionDataPreprocessor.format_shape, such as expected_shape_format or shape_format might better convey its purpose and reduce potential confusion.
  • (Option 2) Deprecating the Transform.FormatShape and making the ActionDataPreprocessor do the shape formatting job.

What alternatives have you considered?

No response

makecent avatar Jan 05 '24 11:01 makecent