[Guide] How to make it work in (Fedora 42) Linux #1005
thedarkbird
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This git does not seem to be very actively maintained anymore, so I had a pretty hard time getting it working in linux. (Surprisingly I got it working quite easily in Windows, including the built-in webui; not so in linux.) So let's go...
The git manual instructs to install python 3.8, but that causes dependency issues , so we'll take 3.10 (learned by trial and error):
conda create -n sadtalker python=3.10 -yconda activate sadtalkerClone the git
git clone https://github.com/OpenTalker/SadTalkercd SadTalkerMake the batch file that downloads the models executable
chmox +x ./scripts/download_models.shDownload models
./scripts/download_models.shInstall the requirements with uv+pip. In my (modest) experience with uv, it's faster and better in resolving package versions than just pip. If you don't have uv, install it with a regular 'sudo dnf install uv' (or apt on Debian-distro's)
uv pip install -r requirements.txtInstall ipykernel to be able to run stuff as a jupyter notebook in VSCode
uv pip install ipykernelThen install ffmpeg via conda:
conda install ffmpeg -yNow there is one dependency that won't work, but instead of downgrading packages we'll just change the code; it's dirty, but quick and avoids a headache. Open this file in a text editor:
~/miniconda3/envs/sadtalker/lib/python3.10/site-packages/basicsr/data/degradations.pyFind:
from torchvision.transforms.functional_tensor import rgb_to_grayscaleReplace by:
from torchvision.transforms import functional as Frgb_to_grayscale = F.rgb_to_grayscaleNow we have a working SadTalker install.
I haven't bothered to get the built-in webui running as it is a sure way to get into another dependency mess. So let's skip that and make it work with a very basic VSCode Jupyter Notebook, or just a regular .py file.
Make a new project directory where you will store your image, audio and jupyter notebook or .py file. Launch VSCode, open the directory, make a new Jupyter Notebook (or .py file) with following code:
Stating the obvious here, but don't forget to change the path and image/audio filenames to YOUR particular case :)
Check the different CLI-command options in the official docs on the git here.
I used SadTalker in combination with Tortoise-TTS and PyTubeFix to make a video that wishes someone a happy birthday:
Worked out quite well for me, but it's a bit involved to get it all up and running. Chatgpt helps :)
Beta Was this translation helpful? Give feedback.
All reactions