This project uses TensorRT to accelerate the SadTalker facerender model.
- Refactor
src/facerender/modules/generator.pyto letOcclusionAwareSPADEGeneratoraccept tensor inputs other than tensor dict. - Write script to export
AnimateFromCoeffgenerator model to ONNX format and then convert to TensorRT Engine. - Develop grid-sample3d-trt-plugin to support
grid_sample3doperation in TensorRT.
-
Clone grid-sample3d-trt-plugin repository and build it, then put the
.sofile into./tensorrt/generator/plugindirectory. -
Export Onnx model and create Engine.
cd tensorrt/generator
python export_onnx.py --checkpoint_dir /path/to/SadTalker-checkpoints
python create_engine.py- Run inference.
python inference_trt.py --checkpoint_dir /path/to/SadTalker-checkpoints