mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

Allow Torch half models

Open ProgramadorArtificial opened this issue 1 year ago • 1 comments

Motivation

Running the model in float16 takes up less memory, less disk space and runs faster. So, I added an option to publish the model and run inference as float16.

Modification

Added a new parameter when publish the model and a condition to check if the model is in float16 to change the input image.

BC-breaking (Optional)

Use cases (Optional)

This PR was created and tested using MMEngine and a PR was created there too: https://github.com/open-mmlab/mmengine/pull/1577 PS: The code works even if one of the libraries (MMPose or MMEngine) is not updated with the new suggested changes.

Checklist

Before PR:

  • [X] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • [X] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • [x] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • [X] New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • [X] The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • [X] CLA has been signed and all committers have signed the CLA in this PR.

ProgramadorArtificial avatar Sep 24 '24 21:09 ProgramadorArtificial