pytoon


Namepytoon JSON
Version 1.4.2 PyPI version JSON
download
home_pagehttps://github.com/lukerbs/apple
SummaryA Python library for lip-syncing cartoons to voice recordings.
upload_time2024-04-07 21:16:53
maintainerNone
docs_urlNone
authorLuke Kerbs
requires_pythonNone
licenseNone
keywords animation forced alignment lip-sync audio forced alignment phoneme generate subtitles
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyToon
## Overview 
PyToon is a Python based animation library for animating characters and their mouth movements. This tools uses machine learning based audio analysis techiques to automatically lip-sync animated character mouth mouth movements to a given audio recording of someone talking.

[Example Output Video](https://youtu.be/fX2loRnr7II)

## Features
- Automatically create cartoon animated lip-sync videos from just an audio file.
- Programmatically generate videos.
- OS Independent! PyToon works on Mac, Windows, and Linux 
- Optimized for both CPU and GPU
- Fast Processing! A 60 second audio clip takes ~52 seconds to generate a lip-synced video.

## Getting Started 
1. Install pytoon: `pip3 install pytoon`
2. Install ffmpeg
    - Mac: `brew install ffmpeg`
    - Linux: `sudo apt install ffmpeg`
    - Windows: Install from [ffmpeg.org](https://ffmpeg.org/download.html)

## Basic Usage
### Generating a Lip-Sync animation and saving to .mp4 file.
```
from pytoon.animator import animate
from moviepy.editor import VideoFileClip

# Read audio transcript to a string.
transcript_path = "./.temp/speech.txt"
with open(transcript_path, "r") as file:
    transcript = file.read()

# Create a Pytoon animation 
animation = animate(
    audio_file="speech.mp3", # input audio
    transcript=transcript, # audio transcript
)

# Overlay the animation on top of another video and save as an .mp4 file.
background_video = VideoFileClip("./path/to/background_video.mp4")
animation.export(path='video.mp4', background=background_video, scale=0.7)
```

## Acknowledgements
This project uses character images created by [lazykh](https://github.com/carykh/lazykh).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lukerbs/apple",
    "name": "pytoon",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "animation, forced alignment, lip-sync, audio forced alignment, phoneme, generate subtitles",
    "author": "Luke Kerbs",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/8e/03/484c900fa9083b9b56092d7856b566e9d3a387e8098abfcb71a8e320e1f8/pytoon-1.4.2.tar.gz",
    "platform": null,
    "description": "# PyToon\n## Overview \nPyToon is a Python based animation library for animating characters and their mouth movements. This tools uses machine learning based audio analysis techiques to automatically lip-sync animated character mouth mouth movements to a given audio recording of someone talking.\n\n[Example Output Video](https://youtu.be/fX2loRnr7II)\n\n## Features\n- Automatically create cartoon animated lip-sync videos from just an audio file.\n- Programmatically generate videos.\n- OS Independent! PyToon works on Mac, Windows, and Linux \n- Optimized for both CPU and GPU\n- Fast Processing! A 60 second audio clip takes ~52 seconds to generate a lip-synced video.\n\n## Getting Started \n1. Install pytoon: `pip3 install pytoon`\n2. Install ffmpeg\n    - Mac: `brew install ffmpeg`\n    - Linux: `sudo apt install ffmpeg`\n    - Windows: Install from [ffmpeg.org](https://ffmpeg.org/download.html)\n\n## Basic Usage\n### Generating a Lip-Sync animation and saving to .mp4 file.\n```\nfrom pytoon.animator import animate\nfrom moviepy.editor import VideoFileClip\n\n# Read audio transcript to a string.\ntranscript_path = \"./.temp/speech.txt\"\nwith open(transcript_path, \"r\") as file:\n    transcript = file.read()\n\n# Create a Pytoon animation \nanimation = animate(\n    audio_file=\"speech.mp3\", # input audio\n    transcript=transcript, # audio transcript\n)\n\n# Overlay the animation on top of another video and save as an .mp4 file.\nbackground_video = VideoFileClip(\"./path/to/background_video.mp4\")\nanimation.export(path='video.mp4', background=background_video, scale=0.7)\n```\n\n## Acknowledgements\nThis project uses character images created by [lazykh](https://github.com/carykh/lazykh).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library for lip-syncing cartoons to voice recordings.",
    "version": "1.4.2",
    "project_urls": {
        "Homepage": "https://github.com/lukerbs/apple"
    },
    "split_keywords": [
        "animation",
        " forced alignment",
        " lip-sync",
        " audio forced alignment",
        " phoneme",
        " generate subtitles"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfe3a4b6a8bb7fa2110a443ad4736abea75d4222d31fe0da752de3e41b140300",
                "md5": "90029472d11d061e301d76cb2122886f",
                "sha256": "99fbb547fe80f2f449421193f20d14bb4d0872be13610af84d05af2c726e455b"
            },
            "downloads": -1,
            "filename": "pytoon-1.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "90029472d11d061e301d76cb2122886f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3831323,
            "upload_time": "2024-04-07T21:16:47",
            "upload_time_iso_8601": "2024-04-07T21:16:47.368929Z",
            "url": "https://files.pythonhosted.org/packages/cf/e3/a4b6a8bb7fa2110a443ad4736abea75d4222d31fe0da752de3e41b140300/pytoon-1.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e03484c900fa9083b9b56092d7856b566e9d3a387e8098abfcb71a8e320e1f8",
                "md5": "e87eb1e20672419318219431a5af5f09",
                "sha256": "74766e7591277cfb86b0e036ddff631dd342ac16f250bd7936969a3462d50f28"
            },
            "downloads": -1,
            "filename": "pytoon-1.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e87eb1e20672419318219431a5af5f09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3827450,
            "upload_time": "2024-04-07T21:16:53",
            "upload_time_iso_8601": "2024-04-07T21:16:53.065317Z",
            "url": "https://files.pythonhosted.org/packages/8e/03/484c900fa9083b9b56092d7856b566e9d3a387e8098abfcb71a8e320e1f8/pytoon-1.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-07 21:16:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lukerbs",
    "github_project": "apple",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pytoon"
}
        
Elapsed time: 0.22221s