-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Live-Portrait ONNX model #126
Comments
Well done, awesome job! TERRIFIC! 👍👍👍 |
Thank you very much for your contribution! Could you please provide the test results for the inference speed? @aihacker111 |
@aihacker111 |
@Sunitha-Thomas It's very easy than you though, just reduce your torch version and make sure it < version 2.0.0 -> it'll work |
@zzzweakman Yeah, sure bro ![]() This run on 354 frames with more than 1 hour ![]() At the same number of frames and inputs, onnx model is boosting x2 faster Noted: I'm tested all of this on Apple Silicon M1 Pro CPU and not using CUDA , not change anything |
Oh for the explain of the question: Why the latest pytorch and onnx version is raising Grid Sample 5D model, |
@Sunitha-Thomas already fixed Grid Example 5D in my source code , you can pull or git clone again |
After testing, change to CUDA mode.
It reported an error and the program aborted. |
@juntaosun please show me the full scripts |
Only CUDA mode is enabled, other codes are the same. like this:
|
@juntaosun thank you , I'll check it later |
@juntaosun only enable cuda , the warping model doesn't run ? , how about CPU |
@juntaosun Thank you, I know where is the bug |
Is this working properly. How do we run it? Just swap the models out or is there more to it? Thanks |
@Echolink50 , git my repo , u can run it |
@juntaosun hey bro , can you check and help me fix the result video is reversed with original video , something mistake in the code |
|
@noname0121 I will update readme later , please wait we need to clean all the code for easy to use |
Thank you very much, have a nice day |
@aihacker111 Author of FaceFusion here, thanks for making this public. We need more people like you in the OS scene. |
@henryruhs Thank you so much, I'm really like your FaceFusion repo , it help me much during my AI engineer Journey ^_^ . I'm plan to convert to TensorRT for optimizing all of this model that help everyone can run it. Thank you |
@juntaosun I'm checked relate to it |
output.mp4this output is from the option real-time webcam not list sequence frames, so clearly it's related to warping.onnx , maybe I'm setting key with wrong output, let me check |
The problem of animation reversal has been solved. warping_network.py
inference_portrait_onnx.py
Now the animation works! 😀😀😀 |
@juntaosun 😂😂😂😂😂 onnx's input never ceases to surprise us as long as the arrays are shuffled |
IS this working on WIndows? Are you all able to use the gradio app.py from Liveportrait? |
Hello @Echolink50 |
Ok. I am trying to install now. I tried to install just like Liveportrait but its saying things can't install in python 3.9 venv? Do I need to use python 3.10 venv? |
Yeah , i’ll group code and installation as easy for everyone can use |
@aihacker111 Can you share you idea about your video summarization plan? Do you mean detect key frames from driving video? |
Video summarization will power if we control pefectly the moment detection in this, as between 2 squence frame we can group 1 frame |
As you can imagine more when we connecting Motion Director (pan left , right, zoom in, out) to get result as a marketing video with more affect as well as animal meme , Deep fake in films when the main have a drama🤣, |
@aihacker111 It seems interesting and I'm thinking how it works. Add video summerization to detect key frames Add video summerization to detect key frames Similar to 1, but use frame interpolation like https://github.com/google-research/frame-interpolation to interpolate other frames, but I forgot the performance of frame interpolation, it could possible slower than spade and warp. |
@kitckso yeah you think right , but we have many open source and idea, so we can create a own idea , just testing and know extractly what we want |
@aihacker111 You're right, there are millions of possibilities by combining 2 or more projects, it is interesting to explore different combinations. |
@kitckso |
#133 Everyone please follow this to get new repo for running |
really, ~70ms/frame, how to do ? |
@warmshao Sorry that it's not accurate, it is the time for "animating" process, i.e. spade and warp. My video is 9s, fps is roughly 25, so frame number should be 2xx, I remember the whole process is around 30s. Roughly 3s to process 1s video. I tested in Linux docker container. |
I also get a about 3 seconds to process each 1 second of video with the main git. I still have yet to get the ONNX branch to use GPU. |
Hello, Is the ONNX feature integrated into GPU and uses CUDA? Thanks |
@MarsEverythingTech not yet, in fixing progress, wait some day Thank you |
ONNX feature updated and next plan in the next week right here: #142 |
Both TensorRT and ONNXRUNTIME-GPU have been implemented in my repository https://github.com/warmshao/FasterLivePortrait. Both have improved speed, especially TensorRT which can achieve real-time rendering a frame at 30+ FPS. Feel free to enjoy it! |
thanks @aihacker111 and @warmshao - any details on how we can replicate the onnx models, converting from the original files? |
my script to export onnx: https://github.com/warmshao/LivePortrait/blob/multi_faces/export_onnx.py |
i use your script to export onnx, but raise error |
@JimLee4530 Upgrade your pytorch version with nightly preview Then you change the opset version from 16 to 20 |
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121 |
thank you very much @warmshao @aihacker111 And change the opset version from 16 to 20 is work! |
Install-free, extract-and-play Windows package with TensorRT support now available! please refer FasterLivePortrait change logs, really convenient and very fast!!! |
@aihacker111 May I ask how did you fix GridSample issue in warping module? Currently, I encounter the below error during the inference with ONNX model. Many thanks. :))
|
This is the link to HuggingFace model id and Github code demo for running project with onnx model which I convert completed 5 original models
I fixed the Grid Sample 5D error and successfully converted the Warping model via ONNX. Besides, other models all work fine and fast
Live Portrait ONNX: https://huggingface.co/myn0908/Live-Portrait-ONNX
Github repo for running my ONNX: https://github.com/aihacker111/Efficient-Live-Portrait
Thank you @cleardusk and your team for great project
The text was updated successfully, but these errors were encountered: