GithubHelp home page GithubHelp logo

circuluspibo / wav2lip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mehdihosseinimoghadam/wav2lip

0.0 1.0 0.0 541 KB

This repository contains the codes of "A Lip Sync Expert Is All You Need for Speech to Lip Generation In the Wild", published at ACM Multimedia 2020.

Home Page: http://bhaasha.iiit.ac.in/lipsync/

Shell 0.19% Python 97.32% Jupyter Notebook 2.49%

wav2lip's Introduction

Wav2Lip

Wav2Lip: Accurately Lip-syncing Videos In The Wild

Wav2Lip wrapper pypi package code for this package is available at: https://github.com/mehdihosseinimoghadam/Wav2Lip also original code from writers of Wav2Lip is available at: https://github.com/Rudrabha/Wav2Lip

Build Status

Open In Colab

Prerequisites

  • Python 3.6
  • ffmpeg: sudo apt-get install ffmpeg
  • Face detection pre-trained model should be downloaded to face_detection/detection/sfd/s3fd.pth. Alternative link if the above does not work.

Getting the weights

Model Description Link to the model
Wav2Lip Highly accurate lip-sync Link
Wav2Lip + GAN Slightly inferior lip-sync, but better visual quality Link
Expert Discriminator Weights of the expert discriminator Link
Visual Quality Discriminator Weights of the visual disc trained in a GAN setup Link

Features

  • Easy to use
  • Fast
  • Accurate

Usage

First of all get the weights:

wget "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth" -O "/usr/local/lib/python3.7/dist-packages/Wav2Lip/face_detection/detection/sfd/gfs3fd.pth"
gdown https://drive.google.com/uc?id=1jQOJInh8cDj2mrbUgcQxhCc7rpAgyV1-

After pip installation add these directories:

mkdir /usr/local/lib/python3.7/dist-packages/Wav2Lip/results
mkdir /usr/local/lib/python3.7/dist-packages/Wav2Lip/temp
mkdir /usr/local/lib/python3.7/dist-packages/Wav2Lip/checkpoints

Then add weights:

mv /content/wav2lip_gan.pth /usr/local/lib/python3.7/dist-packages/Wav2Lip/checkpoints/
&&
cd /usr/local/lib/python3.7/dist-packages/Wav2Lip

Import Wav2Lip wrapper function:

from Wav2Lip.wrapper_app import main
main("/path/to/wav/file","path/to/image")

The resulting video would be in

/usr/local/lib/python3.7/dist-packages/Wav2Lip/results/result_voice.mp4

If you run in colab you can use this script:

from IPython.display import HTML
from base64 import b64encode
mp4 = open('/usr/local/lib/python3.7/dist-packages/Wav2Lip/results/result_voice.mp4','rb').read()
data_url = "data:video/mp4;base64," + b64encode(mp4).decode()
HTML("""
<video width=400 controls>
      <source src="%s" type="video/mp4">
</video>
""" % data_url)

Authors

Name Github Home Page
Mehdi Hosseini Moghadam https://github.com/mehdihosseinimoghadam https://www.linkedin.com/in/mehdi-hosseini-moghadam-384912198/
Hanie Poursina https://github.com/HaniePoursina http://haniepoursina.ir/

Github

Source is avaliable at https://github.com/mehdihosseinimoghadam/Wav2Lip

License

MIT

Free Software, Hell Yeah!

Acknowledgements

This is only a wrapper package and the main code of Wav2Lip can be found in https://github.com/Rudrabha/Wav2Lip

wav2lip's People

Contributors

prajwalkr avatar rudrabha avatar mehdihosseinimoghadam avatar snehitvaddi avatar dipam7 avatar jonathansum avatar mowshon avatar burning846 avatar

Watchers

James Cloos avatar

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.