Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
makecent opened this issue Jan 5, 2024 · 0 comments

Comments

@makecent
Copy link
Contributor

makecent commented Jan 5, 2024

What is the problem this feature will solve?

The argument name format_shape in ActionDataPreprocessor can be misleading:

def __init__(self,
mean: Optional[Sequence[Union[float, int]]] = None,
std: Optional[Sequence[Union[float, int]]] = None,
to_rgb: bool = False,
to_float32: bool = True,
blending: Optional[dict] = None,
format_shape: str = 'NCHW') -> None:
super().__init__()

This name is identical to Transforms.FormatShape:

@TRANSFORMS.register_module()
class FormatShape(BaseTransform):
"""Format final imgs shape to the given input_format.
Required keys:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant