Add support for half precision in face renderer #704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By adding a support for half precision, I was able to speed up the operations by more than 50%.
To use in the inference.py add the
--half
flag. In the gradio demo, created a checkbox for enabling half precision.Initially, I was applying it on all the models in src/modules/make_animation, but then the output head movement was almost non-existant so sticking to applying it only on the main generator. The output is also very similar to the one without half precision but not entirely same.
I have tested it with different combinations of preprocessors and reference videos and did not face an issue, but if there is some test suite to test against please do that or let me know.