GithubHelp home page GithubHelp logo

marlnox / image-animation-turbo-boost Goto Github PK

View Code? Open in Web Editor NEW

This project forked from talkuhulk/image-animation-turbo-boost

0.0 0.0 0.0 34.97 MB

Aim to accelerate the image-animation-model inference through the inference frameworks such as onnx、tensorrt and openvino.

C++ 64.70% Python 32.57% C 2.38% CMake 0.35%

image-animation-turbo-boost's Introduction

Image Animation Turbo Boost

Aim to accelerate the image-animation-model inference through the inference frameworks such as onnx、tensorrt and openvino.


FOMM

The model using from FOMM

Convert

  • Convert to onnx:
python export_onnx.py --output-name-kp kp_detector.onnx --output-name-fomm fomm.onnx --config config/vox-adv-256.yaml --ckpt ./checkpoints/vox-adv-cpk.pth.tar
  • Convert to trt:

dev environment: docker pull chaoyiyuan/tensorrt8:latest

Run:

onnx2trt fomm.onnx -o fomm.trt

Demo


TPSMM

The model using from TPSMM

Convert

  • Convert to onnx:
python export_onnx.py --output-name-kp kp_detector.onnx --output-name-tpsmm tpsmm.onnx --config config/vox-256.yaml --ckpt ./checkpoints/vox.pth.tar
  • Convert to openvino:

dev environment: docker pull openvino/ubuntu18_dev:2021.4.2_src

python3 mo.py --input_model ./tpsmm.onnx  --output_dir ./openvino --data_type FP32

Demo

ONNXRuntime

To test python demo run:

python demo/ONNXRuntime/python/demo.py --source ../assets/source.png --driving ../assets/driving.mp4 --onnx-file-tpsmm tpsmm.onnx --onnx-file-kp kp_detector.onnx

To test c++ demo run:

  • build
mkdir build && cd build
cmake ..
make -j8
./onnx_demo xxx/tpsmm.onnx xxx/kp_detector.onnx xxx/source.png xxx/driving.mp4 ./generated_onnx.mp4

OpenVINO

To test python demo run:

python demo/OpenVINO/python/demo.py --source ../assets/source.png --driving ../assets/driving.mp4 --xml-kp xxxx/kp_detector_sim.xml --xml-tpsmm xxx/tpsmm_sim.xml --bin-kp xxx/kp_detector_sim.bin --bin-tpsmm xxx/tpsmm_sim.bin

To test c++ demo run:

  • build
mkdir build && cd build
cmake ..
make -j8
./openvino_demo xxx/tpsmm.xml xxx/tpsmm.bin xxx/kp_detector.xml xxx/kp_detector.bin xxx/source.png xxx/driving.mp4 ./generated_onnx.mp4

Result

FrameWork Elapsed(s) Language
pytorch(cpu) 6 python
ONNXRuntime ~1.2 python
ONNXRuntime ~1.6 c++
OpenVINO ~0.6 python
OpenVINO ~0.6 c++

ONNXRuntime C++ is slower compared with python, maybe related to libraries which compiled by myself.


generated by python onnx.


generated by python openvino.


generated by cpp onnx.


generated by cpp openvino.

To Do

Failed to convert to tensorrt, maybe scatter ops is not supported. This will be fixed in 8.4GA, according to issues

Pretrained Models

Please download the pre-trained models from the following links.

Path Description
FOMM Original Pretrained Pytorch Model.
TPSMM Original Pretrained Pytorch Model.
FOMM Onnx onnx model of fomm.
FOMM TensorRT trt model of fomm.
TPSMM Onnx onnx model of tpsmm.
TPSMM OpenVINO openvino model of tpsmm.

Acknowledgments

FOMM is AliaksandrSiarohin's work.

TPSMM is yoyo-nb's work.

Thanks for the excellent works!

My work is to modify part of the network,and enable the model can be converted to onnx、openvino or tensorrt.

image-animation-turbo-boost's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.