diff --git a/.gitignore b/.gitignore index bf70b07..c18c57e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .assets .idea .vscode -__pychache__ +__pycache__/ + diff --git a/README.md b/README.md index 7b268dd..5396c89 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # πŸ‘‰πŸΌπŸ‘‰πŸΌπŸ‘‰πŸΌPlease take note of the following information: This repository is compatible and optimized for use with MAC CPU+MPS and Windows with CPU+CUDA. The installation process is not beginner-friendly for enabling CUDA [Toolkit==11.8](https://developer.nvidia.com/cuda-11-8-0-download-archive) and [cuDNN](https://developer.nvidia.com/cudnn-downloads?target_os=Windows&target_arch=x86_64&target_version=Agnostic&cuda_version=11) (CUDA Deep Neural Network). If you are unsure about installing CUDA, you can still use the CPU, and no CUDA installation will be necessary. However, if you are able to install CUDA correctly, the processing speed will increase significantly. -# DeepFuze +# DeepFuze ### Watch the 4k Quality Video on [YOUTUBE](https://youtu.be/PTXMNz2xyVY) ![DeepFuze Lipsync](https://github.com/SamKhoze/ComfyUI-DeepFuze/blob/main/images/LipsyncDemo.gif) @@ -17,7 +17,7 @@ DeepFuze is a state-of-the-art deep learning tool that seamlessly integrates wit --- -# Installation & Models Download +# Installation & Models Download ---- @@ -33,7 +33,7 @@ OR VS [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tool From [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) search for DeepFuze, and install the node. Restart your ComfyUI, and look at your terminal window to ensure there is no error, or Install from the ComfyUI manager, select "Install Via GIT URL", and copy past: https://github.com/SamKhoze/ComfyUI-DeepFuze.git - + ![GitInstall](https://github.com/SamKhoze/ComfyUI-DeepFuze/blob/main/images/Git%20Install.jpg) @@ -41,13 +41,13 @@ From [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) search for D Restart your ComfyUI -## IMPORTANT NOTE: CUDA INSTALLATION IS NOT BEGINNER-FRIENDLY, IF YOU DON'T KNOW WHAT YOU ARE DOING DO NOT TRY, USE THE CPU VERSION. -# CUDA Installation +## IMPORTANT NOTE: CUDA INSTALLATION IS NOT BEGINNER-FRIENDLY, IF YOU DON'T KNOW WHAT YOU ARE DOING DO NOT TRY, USE THE CPU VERSION. +# CUDA Installation **[YOUTUBE LINK](https://youtu.be/ZKhFAF6inR4) step by step instructions** ---- -Install Nvidia CUDA [Toolkit==11.8](https://developer.nvidia.com/cuda-11-8-0-download-archive) and [cuDNN](https://developer.nvidia.com/cudnn-downloads?target_os=Windows&target_arch=x86_64&target_version=Agnostic&cuda_version=11) (CUDA Deep Neural Network) for Deep Learning, you must download the **cuDNN version 8.9.2.26** from the [NVIDIA DEVELOPER cuDNN Archive](https://developer.nvidia.com/rdp/cudnn-archive), if you don't have developer account you can directly download it from [GoogleDrive](https://drive.google.com/file/d/1sBGH8s7OfmkiyMwXBU2iL01bXyODfXgU/view?usp=drive_link). Ensure install **Cuda1 1.8**. I found this [YOUTUBE](https://www.youtube.com/watch?v=ctQi9mU7t9o&t=655s) video useful for installation. If you have a different version of CUDA here is a [YOUTUBE](https://www.youtube.com/watch?v=I3awjvMZw9A&t=2s) link that guides you on how to uninstall your CUDA. Make sure to create paths in your Environment variable as described on [YOUTUBE VIDEO](https://www.youtube.com/watch?v=ctQi9mU7t9o&t=655s) Restart your computer after creating paths. -Confirm your Cuda Installation, paste this code on your terminal window `nvcc --version` you should get a response like this: +Install Nvidia CUDA [Toolkit==11.8](https://developer.nvidia.com/cuda-11-8-0-download-archive) and [cuDNN](https://developer.nvidia.com/cudnn-downloads?target_os=Windows&target_arch=x86_64&target_version=Agnostic&cuda_version=11) (CUDA Deep Neural Network) for Deep Learning, you must download the **cuDNN version 8.9.2.26** from the [NVIDIA DEVELOPER cuDNN Archive](https://developer.nvidia.com/rdp/cudnn-archive), if you don't have developer account you can directly download it from [GoogleDrive](https://drive.google.com/file/d/1sBGH8s7OfmkiyMwXBU2iL01bXyODfXgU/view?usp=drive_link). Ensure install **Cuda1 1.8**. I found this [YOUTUBE](https://www.youtube.com/watch?v=ctQi9mU7t9o&t=655s) video useful for installation. If you have a different version of CUDA here is a [YOUTUBE](https://www.youtube.com/watch?v=I3awjvMZw9A&t=2s) link that guides you on how to uninstall your CUDA. Make sure to create paths in your Environment variable as described on [YOUTUBE VIDEO](https://www.youtube.com/watch?v=ctQi9mU7t9o&t=655s) Restart your computer after creating paths. +Confirm your Cuda Installation, paste this code on your terminal window `nvcc --version` you should get a response like this: ``` nvcc: NVIDIA (R) Cuda compiler driver @@ -65,7 +65,7 @@ Build cuda_11.8.r11.8/compiler.31833905_0` ## For MAC users please set the environment variable before running it Activate your Virtual Environment, Conda or Venv -### Install [Pytorch](https://pytorch.org/) +### Install [Pytorch](https://pytorch.org/) [Here](https://developer.apple.com/metal/pytorch/) how to install and test your PyTorch @@ -83,11 +83,11 @@ pip install onnxruntime ``` **macOS needs to install the original dlib.** ``` -pip install dlib +pip install dlib ``` **Install Text to Speech for Voice Cloning Node** ``` -pip install TTS +pip install coqui-tts ``` **Navigate into** `custom_nodes` **folder** ``` @@ -112,11 +112,11 @@ Clone the repositories: ### Errors 😾 -CV Error: If you encounter the error "ComfyUI_windows_portable\ComfyUI\output\deepfuze\faceswap_file.mp4 could not be loaded with cv," it means that `onnxruntime` is not installed. To fix this, make sure to install `onnxruntime` for CPU and `onnxruntime-gpu` for Windows. Mac users should upgrade OpenCV using the command `pip install --upgrade opencv-python-headless` in their virtual environment. For Windows users, go to ComfyUI Manager, click on "pip install," paste `--upgrade opencv-python-headless`, click OK, and restart your ComfyUI. +CV Error: If you encounter the error "ComfyUI_windows_portable\ComfyUI\output\deepfuze\faceswap_file.mp4 could not be loaded with cv," it means that `onnxruntime` is not installed. To fix this, make sure to install `onnxruntime` for CPU and `onnxruntime-gpu` for Windows. Mac users should upgrade OpenCV using the command `pip install --upgrade opencv-python-headless` in their virtual environment. For Windows users, go to ComfyUI Manager, click on "pip install," paste `--upgrade opencv-python-headless`, click OK, and restart your ComfyUI. ---- -Missing zlibwapi.dll error: Search for NVIDIA zlibwapi.dll file, download it and copy it in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\zlibwapi.dll +Missing zlibwapi.dll error: Search for NVIDIA zlibwapi.dll file, download it and copy it in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\zlibwapi.dll ---- @@ -128,10 +128,10 @@ If you get an error: ImportError: cannot import name 'get_full_repo_name' from ' Run the below codes on your terminal it will solve the issue ``` -conda install chardet +conda install chardet ``` ``` -pip install --upgrade transformers==4.39.2 +pip install --upgrade transformers==4.39.2 ``` if you get any error for any packages, open the requirements.txt file with any text editor remove the version from the front of the package name, and reinstall requirments.txt again @@ -157,7 +157,7 @@ To use the "Openai LLM" node for voice cloning dialogues, you need an OpenAI API ![DeepFuze Lipsync Node example](https://github.com/SamKhoze/ComfyUI-DeepFuze/blob/main/images/DeepFuze_Lipsync_SimpleWorkflow.jpg) This node generates lipsyncing video from, video, image, and audio files. For higher quality export the IMAGE output as an image batch instead of a video combined, you can get up to 4k quality image size. -IMPORTANT: You must load audio with the "VHS load audio" node from the [VideoHelperSuit](https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git) node. +IMPORTANT: You must load audio with the "VHS load audio" node from the [VideoHelperSuit](https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git) node. **Input Types:** - `images`: Extracted frame images as PyTorch tensors. @@ -245,7 +245,7 @@ This node Swaps, Enhances, and Restores faces from, video, and image. or higher **DeepFuze_TTS voice cloning supports 17 languages: English (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Polish (pl), Turkish (tr), Russian (ru), Dutch (nl), Czech (cs), Arabic (ar), Chinese (zh-cn), Japanese (ja), Hungarian (hu), Korean (ko) Hindi (hi).** -This node is used to clone any voice from typed input. The audio file should be 10-15 seconds long for better results and should not have much noise. To avoid any sample rate error, load MP3 audio and only work with [AudioScheduler](https://github.com/a1lazydog/ComfyUI-AudioScheduler) node. We are working on developing a converter node to solve this issue. +This node is used to clone any voice from typed input. The audio file should be 10-15 seconds long for better results and should not have much noise. To avoid any sample rate error, load MP3 audio and only work with [AudioScheduler](https://github.com/a1lazydog/ComfyUI-AudioScheduler) node. We are working on developing a converter node to solve this issue. **Input Types:** - `audio`: An instance of loaded audio data. @@ -260,7 +260,7 @@ This node is used to clone any voice from typed input. The audio file should be ![DeepFuze Openai_Node](https://github.com/SamKhoze/ComfyUI-DeepFuze/blob/main/images/DeepFuze_Openai_LLM_Node.jpg) ![DeepFuze Openai_Node](https://github.com/SamKhoze/ComfyUI-DeepFuze/blob/main/images/DeepFuze_Openai_LLM.jpg) -The "LLM Integration" node is used to incorporate LLM (Language Model) into the voice cloning process. You can input your dialogue and configure parameters, and the AI-generated texts will be employed for voice cloning. Furthermore, you can utilize this node in place of ChatGPT to produce text from LLM or to ask any questions in the same manner as you would with ChatGPT. You can view the output of the DeepFuze_LLM by connecting the LLM_RESPONSE to the "Display Any" node from [rgthree-comfy](https://github.com/rgthree/rgthree-comfy) this node also can be used for prompt generations and any nodes input texts. +The "LLM Integration" node is used to incorporate LLM (Language Model) into the voice cloning process. You can input your dialogue and configure parameters, and the AI-generated texts will be employed for voice cloning. Furthermore, you can utilize this node in place of ChatGPT to produce text from LLM or to ask any questions in the same manner as you would with ChatGPT. You can view the output of the DeepFuze_LLM by connecting the LLM_RESPONSE to the "Display Any" node from [rgthree-comfy](https://github.com/rgthree/rgthree-comfy) this node also can be used for prompt generations and any nodes input texts. **Input Types:** - `user_query`: Type your dialogues. @@ -418,11 +418,11 @@ print(f"Lipsynced video saved at {output_path}") ---- # Acknowledgements -This repository could not have been completed without the contributions from [FaceFusion](https://github.com/facefusion/facefusion), [InsightFace](https://github.com/deepinsight/insightface),[SadTalker](https://github.com/OpenTalker/SadTalker/tree/main), [Facexlib](https://github.com/xinntao/facexlib), [GFPGAN](https://github.com/TencentARC/GFPGAN), [GPEN](https://github.com/yangxy/GPEN), [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN), [TTS](https://github.com/coqui-ai/TTS/tree/dev), [SSD](https://pytorch.org/hub/nvidia_deeplearningexamples_ssd/), and [wav2lip](https://github.com/Rudrabha/Wav2Lip), +This repository could not have been completed without the contributions from [FaceFusion](https://github.com/facefusion/facefusion), [InsightFace](https://github.com/deepinsight/insightface),[SadTalker](https://github.com/OpenTalker/SadTalker/tree/main), [Facexlib](https://github.com/xinntao/facexlib), [GFPGAN](https://github.com/TencentARC/GFPGAN), [GPEN](https://github.com/yangxy/GPEN), [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN), [TTS](https://github.com/coqui-ai/TTS/tree/dev), [SSD](https://pytorch.org/hub/nvidia_deeplearningexamples_ssd/), and [wav2lip](https://github.com/Rudrabha/Wav2Lip), -1. Please carefully read and comply with the open-source license applicable to this code and models before using it. +1. Please carefully read and comply with the open-source license applicable to this code and models before using it. 2. Please carefully read and comply with the intellectual property declaration applicable to this code and models before using it. -3. This open-source code runs completely offline and does not collect any personal information or other data. If you use this code to provide services to end-users and collect related data, please take necessary compliance measures according to applicable laws and regulations (such as publishing privacy policies, adopting necessary data security strategies, etc.). If the collected data involves personal information, user consent must be obtained (if applicable). +3. This open-source code runs completely offline and does not collect any personal information or other data. If you use this code to provide services to end-users and collect related data, please take necessary compliance measures according to applicable laws and regulations (such as publishing privacy policies, adopting necessary data security strategies, etc.). If the collected data involves personal information, user consent must be obtained (if applicable). 4. It is prohibited to use this open-source code for activities that harm the legitimate rights and interests of others (including but not limited to fraud, deception, infringement of others' portrait rights, reputation rights, etc.), or other behaviors that violate applicable laws and regulations or go against social ethics and good customs (including providing incorrect or false information, terrorist, child/minors pornography and violent information, etc.). Otherwise, you may be liable for legal responsibilities. -The DeepFuze code is developed by Dr. Sam Khoze and his team. Feel free to use the DeepFuze code for personal, research, academic, and commercial purposes. You can create videos with this tool, but please make sure to follow local laws and use it responsibly. The developers will not be responsible for any misuse of the tool by users. +The DeepFuze code is developed by Dr. Sam Khoze and his team. Feel free to use the DeepFuze code for personal, research, academic, and commercial purposes. You can create videos with this tool, but please make sure to follow local laws and use it responsibly. The developers will not be responsible for any misuse of the tool by users. diff --git a/TTS/config/__pycache__/__init__.cpython-311.pyc b/TTS/config/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index f244eac..0000000 Binary files a/TTS/config/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/config/__pycache__/shared_configs.cpython-311.pyc b/TTS/config/__pycache__/shared_configs.cpython-311.pyc deleted file mode 100644 index 4f55e59..0000000 Binary files a/TTS/config/__pycache__/shared_configs.cpython-311.pyc and /dev/null differ diff --git a/TTS/encoder/__pycache__/__init__.cpython-311.pyc b/TTS/encoder/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index ad49a98..0000000 Binary files a/TTS/encoder/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/encoder/__pycache__/losses.cpython-311.pyc b/TTS/encoder/__pycache__/losses.cpython-311.pyc deleted file mode 100644 index fce5534..0000000 Binary files a/TTS/encoder/__pycache__/losses.cpython-311.pyc and /dev/null differ diff --git a/TTS/encoder/models/__pycache__/base_encoder.cpython-311.pyc b/TTS/encoder/models/__pycache__/base_encoder.cpython-311.pyc index 51ea66b..68e5d0c 100644 Binary files a/TTS/encoder/models/__pycache__/base_encoder.cpython-311.pyc and b/TTS/encoder/models/__pycache__/base_encoder.cpython-311.pyc differ diff --git a/TTS/encoder/models/__pycache__/lstm.cpython-311.pyc b/TTS/encoder/models/__pycache__/lstm.cpython-311.pyc index ad58d0e..52b896b 100644 Binary files a/TTS/encoder/models/__pycache__/lstm.cpython-311.pyc and b/TTS/encoder/models/__pycache__/lstm.cpython-311.pyc differ diff --git a/TTS/encoder/models/__pycache__/resnet.cpython-311.pyc b/TTS/encoder/models/__pycache__/resnet.cpython-311.pyc index b52f73e..3034aab 100644 Binary files a/TTS/encoder/models/__pycache__/resnet.cpython-311.pyc and b/TTS/encoder/models/__pycache__/resnet.cpython-311.pyc differ diff --git a/TTS/encoder/utils/__pycache__/__init__.cpython-311.pyc b/TTS/encoder/utils/__pycache__/__init__.cpython-311.pyc index ae87314..3a7b233 100644 Binary files a/TTS/encoder/utils/__pycache__/__init__.cpython-311.pyc and b/TTS/encoder/utils/__pycache__/__init__.cpython-311.pyc differ diff --git a/TTS/encoder/utils/__pycache__/generic_utils.cpython-311.pyc b/TTS/encoder/utils/__pycache__/generic_utils.cpython-311.pyc index 68db90c..b298010 100644 Binary files a/TTS/encoder/utils/__pycache__/generic_utils.cpython-311.pyc and b/TTS/encoder/utils/__pycache__/generic_utils.cpython-311.pyc differ diff --git a/TTS/tts/layers/glow_tts/__pycache__/transformer.cpython-311.pyc b/TTS/tts/layers/glow_tts/__pycache__/transformer.cpython-311.pyc index 900439d..0fcd1c2 100644 Binary files a/TTS/tts/layers/glow_tts/__pycache__/transformer.cpython-311.pyc and b/TTS/tts/layers/glow_tts/__pycache__/transformer.cpython-311.pyc differ diff --git a/TTS/tts/layers/vits/__pycache__/discriminator.cpython-311.pyc b/TTS/tts/layers/vits/__pycache__/discriminator.cpython-311.pyc index 37e4226..b571e43 100644 Binary files a/TTS/tts/layers/vits/__pycache__/discriminator.cpython-311.pyc and b/TTS/tts/layers/vits/__pycache__/discriminator.cpython-311.pyc differ diff --git a/TTS/tts/layers/vits/__pycache__/networks.cpython-311.pyc b/TTS/tts/layers/vits/__pycache__/networks.cpython-311.pyc index fdad9c7..68f4aad 100644 Binary files a/TTS/tts/layers/vits/__pycache__/networks.cpython-311.pyc and b/TTS/tts/layers/vits/__pycache__/networks.cpython-311.pyc differ diff --git a/TTS/tts/layers/vits/__pycache__/stochastic_duration_predictor.cpython-311.pyc b/TTS/tts/layers/vits/__pycache__/stochastic_duration_predictor.cpython-311.pyc index ec188c0..d7436a5 100644 Binary files a/TTS/tts/layers/vits/__pycache__/stochastic_duration_predictor.cpython-311.pyc and b/TTS/tts/layers/vits/__pycache__/stochastic_duration_predictor.cpython-311.pyc differ diff --git a/TTS/tts/layers/vits/__pycache__/transforms.cpython-311.pyc b/TTS/tts/layers/vits/__pycache__/transforms.cpython-311.pyc index 7e4f602..3cfb714 100644 Binary files a/TTS/tts/layers/vits/__pycache__/transforms.cpython-311.pyc and b/TTS/tts/layers/vits/__pycache__/transforms.cpython-311.pyc differ diff --git a/TTS/tts/utils/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index df536e9..0000000 Binary files a/TTS/tts/utils/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/data.cpython-311.pyc b/TTS/tts/utils/__pycache__/data.cpython-311.pyc deleted file mode 100644 index 2f72239..0000000 Binary files a/TTS/tts/utils/__pycache__/data.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/fairseq.cpython-311.pyc b/TTS/tts/utils/__pycache__/fairseq.cpython-311.pyc deleted file mode 100644 index 372b69a..0000000 Binary files a/TTS/tts/utils/__pycache__/fairseq.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/helpers.cpython-311.pyc b/TTS/tts/utils/__pycache__/helpers.cpython-311.pyc deleted file mode 100644 index e801680..0000000 Binary files a/TTS/tts/utils/__pycache__/helpers.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/languages.cpython-311.pyc b/TTS/tts/utils/__pycache__/languages.cpython-311.pyc deleted file mode 100644 index ff47018..0000000 Binary files a/TTS/tts/utils/__pycache__/languages.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/managers.cpython-311.pyc b/TTS/tts/utils/__pycache__/managers.cpython-311.pyc deleted file mode 100644 index 9873a6b..0000000 Binary files a/TTS/tts/utils/__pycache__/managers.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/speakers.cpython-311.pyc b/TTS/tts/utils/__pycache__/speakers.cpython-311.pyc deleted file mode 100644 index 0f22e83..0000000 Binary files a/TTS/tts/utils/__pycache__/speakers.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/ssim.cpython-311.pyc b/TTS/tts/utils/__pycache__/ssim.cpython-311.pyc deleted file mode 100644 index e41676d..0000000 Binary files a/TTS/tts/utils/__pycache__/ssim.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/synthesis.cpython-311.pyc b/TTS/tts/utils/__pycache__/synthesis.cpython-311.pyc deleted file mode 100644 index fd8e207..0000000 Binary files a/TTS/tts/utils/__pycache__/synthesis.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/__pycache__/visual.cpython-311.pyc b/TTS/tts/utils/__pycache__/visual.cpython-311.pyc deleted file mode 100644 index b751b22..0000000 Binary files a/TTS/tts/utils/__pycache__/visual.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/monotonic_align/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/monotonic_align/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index ebada3f..0000000 Binary files a/TTS/tts/utils/monotonic_align/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index e7a8868..0000000 Binary files a/TTS/tts/utils/text/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/__pycache__/characters.cpython-311.pyc b/TTS/tts/utils/text/__pycache__/characters.cpython-311.pyc deleted file mode 100644 index a65a338..0000000 Binary files a/TTS/tts/utils/text/__pycache__/characters.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/__pycache__/cleaners.cpython-311.pyc b/TTS/tts/utils/text/__pycache__/cleaners.cpython-311.pyc deleted file mode 100644 index f1a6ba8..0000000 Binary files a/TTS/tts/utils/text/__pycache__/cleaners.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/__pycache__/punctuation.cpython-311.pyc b/TTS/tts/utils/text/__pycache__/punctuation.cpython-311.pyc deleted file mode 100644 index dbaf841..0000000 Binary files a/TTS/tts/utils/text/__pycache__/punctuation.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/__pycache__/tokenizer.cpython-311.pyc b/TTS/tts/utils/text/__pycache__/tokenizer.cpython-311.pyc deleted file mode 100644 index 1b19ec4..0000000 Binary files a/TTS/tts/utils/text/__pycache__/tokenizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/bangla/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/bangla/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 0032192..0000000 Binary files a/TTS/tts/utils/text/bangla/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/bangla/__pycache__/phonemizer.cpython-311.pyc b/TTS/tts/utils/text/bangla/__pycache__/phonemizer.cpython-311.pyc deleted file mode 100644 index 866d18a..0000000 Binary files a/TTS/tts/utils/text/bangla/__pycache__/phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/belarusian/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/belarusian/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index bcb860f..0000000 Binary files a/TTS/tts/utils/text/belarusian/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/belarusian/__pycache__/phonemizer.cpython-311.pyc b/TTS/tts/utils/text/belarusian/__pycache__/phonemizer.cpython-311.pyc deleted file mode 100644 index 74dd08d..0000000 Binary files a/TTS/tts/utils/text/belarusian/__pycache__/phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/chinese_mandarin/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/chinese_mandarin/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index b52b61c..0000000 Binary files a/TTS/tts/utils/text/chinese_mandarin/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/chinese_mandarin/__pycache__/numbers.cpython-311.pyc b/TTS/tts/utils/text/chinese_mandarin/__pycache__/numbers.cpython-311.pyc deleted file mode 100644 index a38005e..0000000 Binary files a/TTS/tts/utils/text/chinese_mandarin/__pycache__/numbers.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/chinese_mandarin/__pycache__/phonemizer.cpython-311.pyc b/TTS/tts/utils/text/chinese_mandarin/__pycache__/phonemizer.cpython-311.pyc deleted file mode 100644 index 7c44666..0000000 Binary files a/TTS/tts/utils/text/chinese_mandarin/__pycache__/phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/chinese_mandarin/__pycache__/pinyinToPhonemes.cpython-311.pyc b/TTS/tts/utils/text/chinese_mandarin/__pycache__/pinyinToPhonemes.cpython-311.pyc deleted file mode 100644 index 3d5134c..0000000 Binary files a/TTS/tts/utils/text/chinese_mandarin/__pycache__/pinyinToPhonemes.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/english/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/english/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 3d29e02..0000000 Binary files a/TTS/tts/utils/text/english/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/english/__pycache__/abbreviations.cpython-311.pyc b/TTS/tts/utils/text/english/__pycache__/abbreviations.cpython-311.pyc deleted file mode 100644 index d7ef772..0000000 Binary files a/TTS/tts/utils/text/english/__pycache__/abbreviations.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/english/__pycache__/number_norm.cpython-311.pyc b/TTS/tts/utils/text/english/__pycache__/number_norm.cpython-311.pyc deleted file mode 100644 index eced88c..0000000 Binary files a/TTS/tts/utils/text/english/__pycache__/number_norm.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/english/__pycache__/time_norm.cpython-311.pyc b/TTS/tts/utils/text/english/__pycache__/time_norm.cpython-311.pyc deleted file mode 100644 index 7a9145d..0000000 Binary files a/TTS/tts/utils/text/english/__pycache__/time_norm.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/french/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/french/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 025be30..0000000 Binary files a/TTS/tts/utils/text/french/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/french/__pycache__/abbreviations.cpython-311.pyc b/TTS/tts/utils/text/french/__pycache__/abbreviations.cpython-311.pyc deleted file mode 100644 index ac2f0d1..0000000 Binary files a/TTS/tts/utils/text/french/__pycache__/abbreviations.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/japanese/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/japanese/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 28517f8..0000000 Binary files a/TTS/tts/utils/text/japanese/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/japanese/__pycache__/phonemizer.cpython-311.pyc b/TTS/tts/utils/text/japanese/__pycache__/phonemizer.cpython-311.pyc deleted file mode 100644 index 161f4bc..0000000 Binary files a/TTS/tts/utils/text/japanese/__pycache__/phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/korean/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/korean/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 110c8a0..0000000 Binary files a/TTS/tts/utils/text/korean/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/korean/__pycache__/ko_dictionary.cpython-311.pyc b/TTS/tts/utils/text/korean/__pycache__/ko_dictionary.cpython-311.pyc deleted file mode 100644 index 057c9c6..0000000 Binary files a/TTS/tts/utils/text/korean/__pycache__/ko_dictionary.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/korean/__pycache__/korean.cpython-311.pyc b/TTS/tts/utils/text/korean/__pycache__/korean.cpython-311.pyc deleted file mode 100644 index 22bd08c..0000000 Binary files a/TTS/tts/utils/text/korean/__pycache__/korean.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/korean/__pycache__/phonemizer.cpython-311.pyc b/TTS/tts/utils/text/korean/__pycache__/phonemizer.cpython-311.pyc deleted file mode 100644 index 959737b..0000000 Binary files a/TTS/tts/utils/text/korean/__pycache__/phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__init__.py b/TTS/tts/utils/text/phonemizers/__init__.py index f9a0340..baf18ed 100644 --- a/TTS/tts/utils/text/phonemizers/__init__.py +++ b/TTS/tts/utils/text/phonemizers/__init__.py @@ -1,79 +1,79 @@ -from TTS.tts.utils.text.phonemizers.bangla_phonemizer import BN_Phonemizer -from TTS.tts.utils.text.phonemizers.base import BasePhonemizer -from TTS.tts.utils.text.phonemizers.belarusian_phonemizer import BEL_Phonemizer -from TTS.tts.utils.text.phonemizers.espeak_wrapper import ESpeak -from TTS.tts.utils.text.phonemizers.gruut_wrapper import Gruut -from TTS.tts.utils.text.phonemizers.ko_kr_phonemizer import KO_KR_Phonemizer -from TTS.tts.utils.text.phonemizers.zh_cn_phonemizer import ZH_CN_Phonemizer - -try: - from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer -except ImportError: - JA_JP_Phonemizer = None - pass - -PHONEMIZERS = {b.name(): b for b in (ESpeak, Gruut, KO_KR_Phonemizer, BN_Phonemizer)} - - -ESPEAK_LANGS = list(ESpeak.supported_languages().keys()) -GRUUT_LANGS = list(Gruut.supported_languages()) - - -# Dict setting default phonemizers for each language -# Add Gruut languages -_ = [Gruut.name()] * len(GRUUT_LANGS) -DEF_LANG_TO_PHONEMIZER = dict(list(zip(GRUUT_LANGS, _))) - - -# Add ESpeak languages and override any existing ones -_ = [ESpeak.name()] * len(ESPEAK_LANGS) -_new_dict = dict(list(zip(list(ESPEAK_LANGS), _))) -DEF_LANG_TO_PHONEMIZER.update(_new_dict) - - -# Force default for some languages -DEF_LANG_TO_PHONEMIZER["en"] = DEF_LANG_TO_PHONEMIZER["en-us"] -DEF_LANG_TO_PHONEMIZER["zh-cn"] = ZH_CN_Phonemizer.name() -DEF_LANG_TO_PHONEMIZER["ko-kr"] = KO_KR_Phonemizer.name() -DEF_LANG_TO_PHONEMIZER["bn"] = BN_Phonemizer.name() -DEF_LANG_TO_PHONEMIZER["be"] = BEL_Phonemizer.name() - - -# JA phonemizer has deal breaking dependencies like MeCab for some systems. -# So we only have it when we have it. -if JA_JP_Phonemizer is not None: - PHONEMIZERS[JA_JP_Phonemizer.name()] = JA_JP_Phonemizer - DEF_LANG_TO_PHONEMIZER["ja-jp"] = JA_JP_Phonemizer.name() - - -def get_phonemizer_by_name(name: str, **kwargs) -> BasePhonemizer: - """Initiate a phonemizer by name - - Args: - name (str): - Name of the phonemizer that should match `phonemizer.name()`. - - kwargs (dict): - Extra keyword arguments that should be passed to the phonemizer. - """ - if name == "espeak": - return ESpeak(**kwargs) - if name == "gruut": - return Gruut(**kwargs) - if name == "zh_cn_phonemizer": - return ZH_CN_Phonemizer(**kwargs) - if name == "ja_jp_phonemizer": - if JA_JP_Phonemizer is None: - raise ValueError(" ❗ You need to install JA phonemizer dependencies. Try `pip install TTS[ja]`.") - return JA_JP_Phonemizer(**kwargs) - if name == "ko_kr_phonemizer": - return KO_KR_Phonemizer(**kwargs) - if name == "bn_phonemizer": - return BN_Phonemizer(**kwargs) - if name == "be_phonemizer": - return BEL_Phonemizer(**kwargs) - raise ValueError(f"Phonemizer {name} not found") - - -if __name__ == "__main__": - print(DEF_LANG_TO_PHONEMIZER) +from TTS.tts.utils.text.phonemizers.bangla_phonemizer import BN_Phonemizer +from TTS.tts.utils.text.phonemizers.base import BasePhonemizer +from TTS.tts.utils.text.phonemizers.belarusian_phonemizer import BEL_Phonemizer +from TTS.tts.utils.text.phonemizers.espeak_wrapper import ESpeak +from TTS.tts.utils.text.phonemizers.gruut_wrapper import Gruut +from TTS.tts.utils.text.phonemizers.ko_kr_phonemizer import KO_KR_Phonemizer +from TTS.tts.utils.text.phonemizers.zh_cn_phonemizer import ZH_CN_Phonemizer + +try: + from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer +except ImportError: + JA_JP_Phonemizer = None + pass + +PHONEMIZERS = {b.name(): b for b in (ESpeak, Gruut, KO_KR_Phonemizer, BN_Phonemizer)} + + +ESPEAK_LANGS = list(ESpeak.supported_languages().keys()) +GRUUT_LANGS = list(Gruut.supported_languages()) + + +# Dict setting default phonemizers for each language +# Add Gruut languages +_ = [Gruut.name()] * len(GRUUT_LANGS) +DEF_LANG_TO_PHONEMIZER = dict(list(zip(GRUUT_LANGS, _))) + + +# Add ESpeak languages and override any existing ones +_ = [ESpeak.name()] * len(ESPEAK_LANGS) +_new_dict = dict(list(zip(list(ESPEAK_LANGS), _))) +DEF_LANG_TO_PHONEMIZER.update(_new_dict) + + +# Force default for some languages +DEF_LANG_TO_PHONEMIZER["en"] = DEF_LANG_TO_PHONEMIZER["en-us"] +DEF_LANG_TO_PHONEMIZER["zh-cn"] = ZH_CN_Phonemizer.name() +DEF_LANG_TO_PHONEMIZER["ko-kr"] = KO_KR_Phonemizer.name() +DEF_LANG_TO_PHONEMIZER["bn"] = BN_Phonemizer.name() +DEF_LANG_TO_PHONEMIZER["be"] = BEL_Phonemizer.name() + + +# JA phonemizer has deal breaking dependencies like MeCab for some systems. +# So we only have it when we have it. +if JA_JP_Phonemizer is not None: + PHONEMIZERS[JA_JP_Phonemizer.name()] = JA_JP_Phonemizer + DEF_LANG_TO_PHONEMIZER["ja-jp"] = JA_JP_Phonemizer.name() + + +def get_phonemizer_by_name(name: str, **kwargs) -> BasePhonemizer: + """Initiate a phonemizer by name + + Args: + name (str): + Name of the phonemizer that should match `phonemizer.name()`. + + kwargs (dict): + Extra keyword arguments that should be passed to the phonemizer. + """ + if name == "espeak": + return ESpeak(**kwargs) + if name == "gruut": + return Gruut(**kwargs) + if name == "zh_cn_phonemizer": + return ZH_CN_Phonemizer(**kwargs) + if name == "ja_jp_phonemizer": + if JA_JP_Phonemizer is None: + raise ValueError(" ❗ You need to install JA phonemizer dependencies. Try `pip install coqui-tts[ja]`.") + return JA_JP_Phonemizer(**kwargs) + if name == "ko_kr_phonemizer": + return KO_KR_Phonemizer(**kwargs) + if name == "bn_phonemizer": + return BN_Phonemizer(**kwargs) + if name == "be_phonemizer": + return BEL_Phonemizer(**kwargs) + raise ValueError(f"Phonemizer {name} not found") + + +if __name__ == "__main__": + print(DEF_LANG_TO_PHONEMIZER) diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/__init__.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 2e9dadd..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/bangla_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/bangla_phonemizer.cpython-311.pyc deleted file mode 100644 index 1791144..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/bangla_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/base.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/base.cpython-311.pyc deleted file mode 100644 index 44b74f3..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/base.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/belarusian_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/belarusian_phonemizer.cpython-311.pyc deleted file mode 100644 index cf5feb6..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/belarusian_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/espeak_wrapper.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/espeak_wrapper.cpython-311.pyc deleted file mode 100644 index d01db29..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/espeak_wrapper.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/gruut_wrapper.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/gruut_wrapper.cpython-311.pyc deleted file mode 100644 index f65242a..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/gruut_wrapper.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/ja_jp_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/ja_jp_phonemizer.cpython-311.pyc deleted file mode 100644 index 51a505d..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/ja_jp_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/ko_kr_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/ko_kr_phonemizer.cpython-311.pyc deleted file mode 100644 index ceb7205..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/ko_kr_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/multi_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/multi_phonemizer.cpython-311.pyc deleted file mode 100644 index a9f786a..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/multi_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/tts/utils/text/phonemizers/__pycache__/zh_cn_phonemizer.cpython-311.pyc b/TTS/tts/utils/text/phonemizers/__pycache__/zh_cn_phonemizer.cpython-311.pyc deleted file mode 100644 index 847defc..0000000 Binary files a/TTS/tts/utils/text/phonemizers/__pycache__/zh_cn_phonemizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/__init__.cpython-311.pyc b/TTS/utils/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 4abc14c..0000000 Binary files a/TTS/utils/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/generic_utils.cpython-311.pyc b/TTS/utils/__pycache__/generic_utils.cpython-311.pyc deleted file mode 100644 index 6b8a83c..0000000 Binary files a/TTS/utils/__pycache__/generic_utils.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/io.cpython-311.pyc b/TTS/utils/__pycache__/io.cpython-311.pyc deleted file mode 100644 index decdb56..0000000 Binary files a/TTS/utils/__pycache__/io.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/manage.cpython-311.pyc b/TTS/utils/__pycache__/manage.cpython-311.pyc deleted file mode 100644 index 4b15463..0000000 Binary files a/TTS/utils/__pycache__/manage.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/samplers.cpython-311.pyc b/TTS/utils/__pycache__/samplers.cpython-311.pyc deleted file mode 100644 index d93fa4b..0000000 Binary files a/TTS/utils/__pycache__/samplers.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/__pycache__/synthesizer.cpython-311.pyc b/TTS/utils/__pycache__/synthesizer.cpython-311.pyc deleted file mode 100644 index 9684e8e..0000000 Binary files a/TTS/utils/__pycache__/synthesizer.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/audio/__pycache__/__init__.cpython-311.pyc b/TTS/utils/audio/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 1060a43..0000000 Binary files a/TTS/utils/audio/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/audio/__pycache__/numpy_transforms.cpython-311.pyc b/TTS/utils/audio/__pycache__/numpy_transforms.cpython-311.pyc deleted file mode 100644 index 1856323..0000000 Binary files a/TTS/utils/audio/__pycache__/numpy_transforms.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/audio/__pycache__/processor.cpython-311.pyc b/TTS/utils/audio/__pycache__/processor.cpython-311.pyc deleted file mode 100644 index faa74a5..0000000 Binary files a/TTS/utils/audio/__pycache__/processor.cpython-311.pyc and /dev/null differ diff --git a/TTS/utils/audio/__pycache__/torch_transforms.cpython-311.pyc b/TTS/utils/audio/__pycache__/torch_transforms.cpython-311.pyc deleted file mode 100644 index 0904835..0000000 Binary files a/TTS/utils/audio/__pycache__/torch_transforms.cpython-311.pyc and /dev/null differ diff --git a/TTS/vc/configs/__pycache__/__init__.cpython-311.pyc b/TTS/vc/configs/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 84205b7..0000000 Binary files a/TTS/vc/configs/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vc/models/__pycache__/__init__.cpython-311.pyc b/TTS/vc/models/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 2c28146..0000000 Binary files a/TTS/vc/models/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index a6bac69..0000000 Binary files a/TTS/vocoder/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 3b04c0b..0000000 Binary files a/TTS/vocoder/configs/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/fullband_melgan_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/fullband_melgan_config.cpython-311.pyc deleted file mode 100644 index de36d1d..0000000 Binary files a/TTS/vocoder/configs/__pycache__/fullband_melgan_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/hifigan_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/hifigan_config.cpython-311.pyc deleted file mode 100644 index a3db592..0000000 Binary files a/TTS/vocoder/configs/__pycache__/hifigan_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/melgan_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/melgan_config.cpython-311.pyc deleted file mode 100644 index 5e9abea..0000000 Binary files a/TTS/vocoder/configs/__pycache__/melgan_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/multiband_melgan_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/multiband_melgan_config.cpython-311.pyc deleted file mode 100644 index 60702af..0000000 Binary files a/TTS/vocoder/configs/__pycache__/multiband_melgan_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/parallel_wavegan_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/parallel_wavegan_config.cpython-311.pyc deleted file mode 100644 index cfaae40..0000000 Binary files a/TTS/vocoder/configs/__pycache__/parallel_wavegan_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/shared_configs.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/shared_configs.cpython-311.pyc deleted file mode 100644 index 96822f1..0000000 Binary files a/TTS/vocoder/configs/__pycache__/shared_configs.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/univnet_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/univnet_config.cpython-311.pyc deleted file mode 100644 index 369f5c4..0000000 Binary files a/TTS/vocoder/configs/__pycache__/univnet_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/wavegrad_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/wavegrad_config.cpython-311.pyc deleted file mode 100644 index 00e0a12..0000000 Binary files a/TTS/vocoder/configs/__pycache__/wavegrad_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/configs/__pycache__/wavernn_config.cpython-311.pyc b/TTS/vocoder/configs/__pycache__/wavernn_config.cpython-311.pyc deleted file mode 100644 index ee7379f..0000000 Binary files a/TTS/vocoder/configs/__pycache__/wavernn_config.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/datasets/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/datasets/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 10ae7ca..0000000 Binary files a/TTS/vocoder/datasets/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/datasets/__pycache__/gan_dataset.cpython-311.pyc b/TTS/vocoder/datasets/__pycache__/gan_dataset.cpython-311.pyc deleted file mode 100644 index 69aa451..0000000 Binary files a/TTS/vocoder/datasets/__pycache__/gan_dataset.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/datasets/__pycache__/preprocess.cpython-311.pyc b/TTS/vocoder/datasets/__pycache__/preprocess.cpython-311.pyc deleted file mode 100644 index 2fcfe07..0000000 Binary files a/TTS/vocoder/datasets/__pycache__/preprocess.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/datasets/__pycache__/wavegrad_dataset.cpython-311.pyc b/TTS/vocoder/datasets/__pycache__/wavegrad_dataset.cpython-311.pyc deleted file mode 100644 index e980a82..0000000 Binary files a/TTS/vocoder/datasets/__pycache__/wavegrad_dataset.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/datasets/__pycache__/wavernn_dataset.cpython-311.pyc b/TTS/vocoder/datasets/__pycache__/wavernn_dataset.cpython-311.pyc deleted file mode 100644 index 400487c..0000000 Binary files a/TTS/vocoder/datasets/__pycache__/wavernn_dataset.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/layers/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/layers/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 406b479..0000000 Binary files a/TTS/vocoder/layers/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/layers/__pycache__/losses.cpython-311.pyc b/TTS/vocoder/layers/__pycache__/losses.cpython-311.pyc deleted file mode 100644 index 0705e9a..0000000 Binary files a/TTS/vocoder/layers/__pycache__/losses.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/layers/__pycache__/wavegrad.cpython-311.pyc b/TTS/vocoder/layers/__pycache__/wavegrad.cpython-311.pyc deleted file mode 100644 index 413ffdb..0000000 Binary files a/TTS/vocoder/layers/__pycache__/wavegrad.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/models/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 40c5c0e..0000000 Binary files a/TTS/vocoder/models/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/base_vocoder.cpython-311.pyc b/TTS/vocoder/models/__pycache__/base_vocoder.cpython-311.pyc deleted file mode 100644 index 32f6bfe..0000000 Binary files a/TTS/vocoder/models/__pycache__/base_vocoder.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/hifigan_discriminator.cpython-311.pyc b/TTS/vocoder/models/__pycache__/hifigan_discriminator.cpython-311.pyc deleted file mode 100644 index 9b8812d..0000000 Binary files a/TTS/vocoder/models/__pycache__/hifigan_discriminator.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/hifigan_generator.cpython-311.pyc b/TTS/vocoder/models/__pycache__/hifigan_generator.cpython-311.pyc deleted file mode 100644 index 10f90ce..0000000 Binary files a/TTS/vocoder/models/__pycache__/hifigan_generator.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/wavegrad.cpython-311.pyc b/TTS/vocoder/models/__pycache__/wavegrad.cpython-311.pyc deleted file mode 100644 index 3cafbff..0000000 Binary files a/TTS/vocoder/models/__pycache__/wavegrad.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/models/__pycache__/wavernn.cpython-311.pyc b/TTS/vocoder/models/__pycache__/wavernn.cpython-311.pyc deleted file mode 100644 index 26eb7f3..0000000 Binary files a/TTS/vocoder/models/__pycache__/wavernn.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/utils/__pycache__/__init__.cpython-311.pyc b/TTS/vocoder/utils/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 85d7917..0000000 Binary files a/TTS/vocoder/utils/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/utils/__pycache__/distribution.cpython-311.pyc b/TTS/vocoder/utils/__pycache__/distribution.cpython-311.pyc deleted file mode 100644 index fbd1783..0000000 Binary files a/TTS/vocoder/utils/__pycache__/distribution.cpython-311.pyc and /dev/null differ diff --git a/TTS/vocoder/utils/__pycache__/generic_utils.cpython-311.pyc b/TTS/vocoder/utils/__pycache__/generic_utils.cpython-311.pyc deleted file mode 100644 index 5e04547..0000000 Binary files a/TTS/vocoder/utils/__pycache__/generic_utils.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/content_analyser.py b/deepfuze/content_analyser.py index 71bf91f..9b35909 100644 --- a/deepfuze/content_analyser.py +++ b/deepfuze/content_analyser.py @@ -20,7 +20,7 @@ { 'open_nsfw': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/open_nsfw.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/open_nsfw.onnx', 'path': resolve_relative_path('../../../models/deepfuze/open_nsfw.onnx') } } diff --git a/deepfuze/core.py b/deepfuze/core.py index 2f77f79..7587a2d 100755 --- a/deepfuze/core.py +++ b/deepfuze/core.py @@ -109,7 +109,7 @@ def cli() -> None: group_uis = program.add_argument_group('uis') group_uis.add_argument('--open-browser', help=wording.get('help.open_browser'), action = 'store_true', default = config.get_bool_value('uis.open_browser')) group_uis.add_argument('--ui-layouts', help = wording.get('help.ui_layouts').format(choices = ', '.join(available_ui_layouts)), default = config.get_str_list('uis.ui_layouts', 'default'), nargs = '+') - run(program) + return run(program) def apply_config(program : ArgumentParser) -> None: @@ -208,7 +208,7 @@ def apply_args(program : ArgumentParser) -> None: deepfuze.globals.ui_layouts = args.ui_layouts -def run(program : ArgumentParser) -> None: +def run(program : ArgumentParser) -> int: validate_args(program) apply_args(program) logger.init(deepfuze.globals.log_level) @@ -219,10 +219,12 @@ def run(program : ArgumentParser) -> None: force_download() return if not pre_check() or not content_analyser.pre_check() or not face_analyser.pre_check() or not face_masker.pre_check() or not voice_extractor.pre_check(): - return + print("pre_check failed") + return -1 for frame_processor_module in get_frame_processors_modules(deepfuze.globals.frame_processors): if not frame_processor_module.pre_check(): - return + print("pre_check failed") + return -1 if deepfuze.globals.headless: conditional_process() else: @@ -230,9 +232,10 @@ def run(program : ArgumentParser) -> None: for ui_layout in ui.get_ui_layouts_modules(deepfuze.globals.ui_layouts): if not ui_layout.pre_check(): - return + print("pre_check failed") + return -1 ui.launch() - + return 0 def destroy() -> None: process_manager.stop() @@ -298,7 +301,7 @@ def force_download() -> None: face_masker.MODELS, voice_extractor.MODELS ] - + for frame_processor_module in get_frame_processors_modules(available_frame_processors): if hasattr(frame_processor_module, 'MODELS'): model_list.append(frame_processor_module.MODELS) diff --git a/deepfuze/download.py b/deepfuze/download.py index 5e53edd..5658fb2 100644 --- a/deepfuze/download.py +++ b/deepfuze/download.py @@ -16,8 +16,8 @@ def conditional_download(download_directory_path : str, urls : List[str]) -> None: - print("here..",download_directory_path) for url in urls: + print(f"Download {url} to {download_directory_path}") download_file_path = os.path.join(download_directory_path, os.path.basename(url)) initial_size = get_file_size(download_file_path) download_size = get_download_size(url) diff --git a/deepfuze/face_analyser.py b/deepfuze/face_analyser.py index 1cc3c85..07df3b6 100644 --- a/deepfuze/face_analyser.py +++ b/deepfuze/face_analyser.py @@ -21,57 +21,57 @@ { 'face_detector_retinaface': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/retinaface_10g.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/retinaface_10g.onnx', 'path': resolve_relative_path('../../../models/deepfuze/retinaface_10g.onnx') }, 'face_detector_scrfd': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/scrfd_2.5g.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/scrfd_2.5g.onnx', 'path': resolve_relative_path('../../../models/deepfuze/scrfd_2.5g.onnx') }, 'face_detector_yoloface': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/yoloface_8n.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/yoloface_8n.onnx', 'path': resolve_relative_path('../../../models/deepfuze/yoloface_8n.onnx') }, 'face_detector_yunet': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/yunet_2023mar.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/yunet_2023mar.onnx', 'path': resolve_relative_path('../../../models/deepfuze/yunet_2023mar.onnx') }, 'face_recognizer_arcface_blendswap': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/arcface_w600k_r50.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/arcface_w600k_r50.onnx', 'path': resolve_relative_path('../../../models/deepfuze/arcface_w600k_r50.onnx') }, 'face_recognizer_arcface_inswapper': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/arcface_w600k_r50.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/arcface_w600k_r50.onnx', 'path': resolve_relative_path('../../../models/deepfuze/arcface_w600k_r50.onnx') }, 'face_recognizer_arcface_simswap': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/arcface_simswap.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/arcface_simswap.onnx', 'path': resolve_relative_path('../../../models/deepfuze/arcface_simswap.onnx') }, 'face_recognizer_arcface_uniface': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/arcface_w600k_r50.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/arcface_w600k_r50.onnx', 'path': resolve_relative_path('../../../models/deepfuze/arcface_w600k_r50.onnx') }, 'face_landmarker_68': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/2dfan4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/2dfan4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/2dfan4.onnx') }, 'face_landmarker_68_5': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/face_landmarker_68_5.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/face_landmarker_68_5.onnx', 'path': resolve_relative_path('../../../models/deepfuze/face_landmarker_68_5.onnx') }, 'gender_age': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gender_age.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/gender_age.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gender_age.onnx') } } diff --git a/deepfuze/face_masker.py b/deepfuze/face_masker.py index bf3c366..f454985 100755 --- a/deepfuze/face_masker.py +++ b/deepfuze/face_masker.py @@ -20,12 +20,12 @@ { 'face_occluder': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/face_occluder.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/face_occluder.onnx', 'path': resolve_relative_path('../../../models/deepfuze/face_occluder.onnx') }, 'face_parser': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/face_parser.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/face_parser.onnx', 'path': resolve_relative_path('../../../models/deepfuze/face_parser.onnx') } } diff --git a/deepfuze/processors/__pycache__/__init__.cpython-310.pyc b/deepfuze/processors/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index c08eed1..0000000 Binary files a/deepfuze/processors/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/__pycache__/__init__.cpython-311.pyc b/deepfuze/processors/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 96438c6..0000000 Binary files a/deepfuze/processors/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/__init__.cpython-310.pyc b/deepfuze/processors/frame/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 36eb4f3..0000000 Binary files a/deepfuze/processors/frame/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/__init__.cpython-311.pyc b/deepfuze/processors/frame/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 5720c24..0000000 Binary files a/deepfuze/processors/frame/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/choices.cpython-310.pyc b/deepfuze/processors/frame/__pycache__/choices.cpython-310.pyc deleted file mode 100644 index 93efcdf..0000000 Binary files a/deepfuze/processors/frame/__pycache__/choices.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/choices.cpython-311.pyc b/deepfuze/processors/frame/__pycache__/choices.cpython-311.pyc deleted file mode 100644 index 320bd46..0000000 Binary files a/deepfuze/processors/frame/__pycache__/choices.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/core.cpython-310.pyc b/deepfuze/processors/frame/__pycache__/core.cpython-310.pyc deleted file mode 100644 index c01a8ba..0000000 Binary files a/deepfuze/processors/frame/__pycache__/core.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/core.cpython-311.pyc b/deepfuze/processors/frame/__pycache__/core.cpython-311.pyc deleted file mode 100644 index 8a7818e..0000000 Binary files a/deepfuze/processors/frame/__pycache__/core.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/globals.cpython-310.pyc b/deepfuze/processors/frame/__pycache__/globals.cpython-310.pyc deleted file mode 100644 index 518cdfc..0000000 Binary files a/deepfuze/processors/frame/__pycache__/globals.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/globals.cpython-311.pyc b/deepfuze/processors/frame/__pycache__/globals.cpython-311.pyc deleted file mode 100644 index 4d035fa..0000000 Binary files a/deepfuze/processors/frame/__pycache__/globals.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/typings.cpython-310.pyc b/deepfuze/processors/frame/__pycache__/typings.cpython-310.pyc deleted file mode 100644 index c7ff5d2..0000000 Binary files a/deepfuze/processors/frame/__pycache__/typings.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/__pycache__/typings.cpython-311.pyc b/deepfuze/processors/frame/__pycache__/typings.cpython-311.pyc deleted file mode 100644 index 3c16fe3..0000000 Binary files a/deepfuze/processors/frame/__pycache__/typings.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 7a49965..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 36321b5..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-310.pyc deleted file mode 100644 index 4828999..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-311.pyc deleted file mode 100644 index d726eef..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_debugger.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-310.pyc deleted file mode 100644 index c0bc8d9..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-311.pyc deleted file mode 100644 index 25adbdc..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_enhancer.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-310.pyc deleted file mode 100644 index 59e522c..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-311.pyc deleted file mode 100644 index 9262bfd..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/face_swapper.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-310.pyc deleted file mode 100644 index 54ed46a..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-311.pyc deleted file mode 100644 index 4de53d7..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/frame_colorizer.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-310.pyc deleted file mode 100644 index df8ddbc..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-311.pyc deleted file mode 100644 index 5e04369..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/frame_enhancer.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-310.pyc b/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-310.pyc deleted file mode 100644 index f3c0e56..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-310.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-311.pyc b/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-311.pyc deleted file mode 100644 index 4f179b2..0000000 Binary files a/deepfuze/processors/frame/modules/__pycache__/lip_syncer.cpython-311.pyc and /dev/null differ diff --git a/deepfuze/processors/frame/modules/face_enhancer.py b/deepfuze/processors/frame/modules/face_enhancer.py index de58d77..af89c56 100755 --- a/deepfuze/processors/frame/modules/face_enhancer.py +++ b/deepfuze/processors/frame/modules/face_enhancer.py @@ -31,63 +31,63 @@ { 'codeformer': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/codeformer.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/codeformer.onnx', 'path': resolve_relative_path('../../../models/deepfuze/codeformer.onnx'), 'template': 'ffhq_512', 'size': (512, 512) }, 'gfpgan_1.2': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gfpgan_1.2.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gfpgan_1.2.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gfpgan_1.2.onnx'), 'template': 'ffhq_512', 'size': (512, 512) }, 'gfpgan_1.3': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gfpgan_1.3.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gfpgan_1.3.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gfpgan_1.3.onnx'), 'template': 'ffhq_512', 'size': (512, 512) }, 'gfpgan_1.4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gfpgan_1.4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gfpgan_1.4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gfpgan_1.4.onnx'), 'template': 'ffhq_512', 'size': (512, 512) }, 'gpen_bfr_256': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gpen_bfr_256.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gpen_bfr_256.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gpen_bfr_256.onnx'), 'template': 'arcface_128_v2', 'size': (256, 256) }, 'gpen_bfr_512': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gpen_bfr_512.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gpen_bfr_512.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gpen_bfr_512.onnx'), 'template': 'ffhq_512', 'size': (512, 512) }, 'gpen_bfr_1024': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gpen_bfr_1024.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gpen_bfr_1024.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gpen_bfr_1024.onnx'), 'template': 'ffhq_512', 'size': (1024, 1024) }, 'gpen_bfr_2048': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/gpen_bfr_2048.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/gpen_bfr_2048.onnx', 'path': resolve_relative_path('../../../models/deepfuze/gpen_bfr_2048.onnx'), 'template': 'ffhq_512', 'size': (2048, 2048) }, 'restoreformer_plus_plus': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/restoreformer_plus_plus.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/restoreformer_plus_plus.onnx', 'path': resolve_relative_path('../../../models/deepfuze/restoreformer_plus_plus.onnx'), 'template': 'ffhq_512', 'size': (512, 512) diff --git a/deepfuze/processors/frame/modules/face_swapper.py b/deepfuze/processors/frame/modules/face_swapper.py index 49f5068..5287d05 100755 --- a/deepfuze/processors/frame/modules/face_swapper.py +++ b/deepfuze/processors/frame/modules/face_swapper.py @@ -33,7 +33,7 @@ 'blendswap_256': { 'type': 'blendswap', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/blendswap_256.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/blendswap_256.onnx', 'path': resolve_relative_path('../../../models/deepfuze/blendswap_256.onnx'), 'template': 'ffhq_512', 'size': (256, 256), @@ -43,7 +43,7 @@ 'inswapper_128': { 'type': 'inswapper', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/inswapper_128.onnx', 'path': resolve_relative_path('../../../models/deepfuze/inswapper_128.onnx'), 'template': 'arcface_128_v2', 'size': (128, 128), @@ -53,7 +53,7 @@ 'inswapper_128_fp16': { 'type': 'inswapper', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128_fp16.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/inswapper_128_fp16.onnx', 'path': resolve_relative_path('../../../models/deepfuze/inswapper_128_fp16.onnx'), 'template': 'arcface_128_v2', 'size': (128, 128), @@ -63,7 +63,7 @@ 'simswap_256': { 'type': 'simswap', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/simswap_256.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/simswap_256.onnx', 'path': resolve_relative_path('../../../models/deepfuze/simswap_256.onnx'), 'template': 'arcface_112_v1', 'size': (256, 256), @@ -73,7 +73,7 @@ 'simswap_512_unofficial': { 'type': 'simswap', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/simswap_512_unofficial.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/simswap_512_unofficial.onnx', 'path': resolve_relative_path('../../../models/deepfuze/simswap_512_unofficial.onnx'), 'template': 'arcface_112_v1', 'size': (512, 512), @@ -83,7 +83,7 @@ 'uniface_256': { 'type': 'uniface', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/uniface_256.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/uniface_256.onnx', 'path': resolve_relative_path('../../../models/deepfuze/uniface_256.onnx'), 'template': 'ffhq_512', 'size': (256, 256), diff --git a/deepfuze/processors/frame/modules/frame_colorizer.py b/deepfuze/processors/frame/modules/frame_colorizer.py index 1305746..d89bb0b 100644 --- a/deepfuze/processors/frame/modules/frame_colorizer.py +++ b/deepfuze/processors/frame/modules/frame_colorizer.py @@ -29,31 +29,31 @@ 'ddcolor': { 'type': 'ddcolor', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/ddcolor.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/ddcolor.onnx', 'path': resolve_relative_path('../../../models/deepfuze/ddcolor.onnx') }, 'ddcolor_artistic': { 'type': 'ddcolor', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/ddcolor_artistic.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/ddcolor_artistic.onnx', 'path': resolve_relative_path('../../../models/deepfuze/ddcolor_artistic.onnx') }, 'deoldify': { 'type': 'deoldify', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/deoldify.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/deoldify.onnx', 'path': resolve_relative_path('../../../models/deepfuze/deoldify.onnx') }, 'deoldify_artistic': { 'type': 'deoldify', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/deoldify_artistic.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/deoldify_artistic.onnx', 'path': resolve_relative_path('../../../models/deepfuze/deoldify_artistic.onnx') }, 'deoldify_stable': { 'type': 'deoldify', - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/deoldify_stable.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/deoldify_stable.onnx', 'path': resolve_relative_path('../../../models/deepfuze/deoldify_stable.onnx') } } diff --git a/deepfuze/processors/frame/modules/frame_enhancer.py b/deepfuze/processors/frame/modules/frame_enhancer.py index 40d2f3e..acbad4a 100644 --- a/deepfuze/processors/frame/modules/frame_enhancer.py +++ b/deepfuze/processors/frame/modules/frame_enhancer.py @@ -28,70 +28,70 @@ { 'clear_reality_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/clear_reality_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/clear_reality_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/clear_reality_x4.onnx'), 'size': (128, 8, 4), 'scale': 4 }, 'lsdir_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/lsdir_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/lsdir_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/lsdir_x4.onnx'), 'size': (128, 8, 4), 'scale': 4 }, 'nomos8k_sc_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/nomos8k_sc_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/nomos8k_sc_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/nomos8k_sc_x4.onnx'), 'size': (128, 8, 4), 'scale': 4 }, 'real_esrgan_x2': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/real_esrgan_x2.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/real_esrgan_x2.onnx', 'path': resolve_relative_path('../../../models/deepfuze/real_esrgan_x2.onnx'), 'size': (256, 16, 8), 'scale': 2 }, 'real_esrgan_x2_fp16': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/real_esrgan_x2_fp16.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/real_esrgan_x2_fp16.onnx', 'path': resolve_relative_path('../../../models/deepfuze/real_esrgan_x2_fp16.onnx'), 'size': (256, 16, 8), 'scale': 2 }, 'real_esrgan_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/real_esrgan_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/real_esrgan_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/real_esrgan_x4.onnx'), 'size': (256, 16, 8), 'scale': 4 }, 'real_esrgan_x4_fp16': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/real_esrgan_x4_fp16.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/real_esrgan_x4_fp16.onnx', 'path': resolve_relative_path('../../../models/deepfuze/real_esrgan_x4_fp16.onnx'), 'size': (256, 16, 8), 'scale': 4 }, 'real_hatgan_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/real_hatgan_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/real_hatgan_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/real_hatgan_x4.onnx'), 'size': (256, 16, 8), 'scale': 4 }, 'span_kendata_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/span_kendata_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/span_kendata_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/span_kendata_x4.onnx'), 'size': (128, 8, 4), 'scale': 4 }, 'ultra_sharp_x4': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/ultra_sharp_x4.onnx', + 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models-3.0.0/ultra_sharp_x4.onnx', 'path': resolve_relative_path('../../../models/deepfuze/ultra_sharp_x4.onnx'), 'size': (128, 8, 4), 'scale': 4 diff --git a/deepfuze/processors/frame/modules/lip_syncer.py b/deepfuze/processors/frame/modules/lip_syncer.py index 599eb49..497ecbf 100755 --- a/deepfuze/processors/frame/modules/lip_syncer.py +++ b/deepfuze/processors/frame/modules/lip_syncer.py @@ -34,7 +34,7 @@ { 'wav2lip_gan': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/wav2lip_gan.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/wav2lip_gan.onnx', 'path': resolve_relative_path('../../../models/deepfuze/wav2lip_gan.onnx') } } diff --git a/deepfuze/voice_extractor.py b/deepfuze/voice_extractor.py index 222d193..db68518 100644 --- a/deepfuze/voice_extractor.py +++ b/deepfuze/voice_extractor.py @@ -17,7 +17,7 @@ { 'voice_extractor': { - 'url': 'https://github.com/facefusion/facefusion-assets/releases/download/models/voice_extractor.onnx', + 'url': 'https://huggingface.co/JackCui/facefusion/resolve/main/voice_extractor.onnx', 'path': resolve_relative_path('../../../models/deepfuze/voice_extractor.onnx') } } diff --git a/tts_generation.py b/tts_generation.py index 853566e..d0271cd 100644 --- a/tts_generation.py +++ b/tts_generation.py @@ -11,16 +11,20 @@ def main(): parser = argparse.ArgumentParser(description="Run TTS with specified parameters.") - + parser.add_argument('--model', type=str, default="tts_models/multilingual/multi-dataset/xtts_v2", help="The TTS model to use.") parser.add_argument('--text', type=str, required=True, help="The text to be converted to speech.") parser.add_argument('--speaker_wav', type=str, required=True, help="The path to the speaker's wav file for voice cloning.") parser.add_argument('--language', type=str, default="en", help="The language of the text.") parser.add_argument('--output_file', type=str, default="output.wav", help="The output file path for the synthesized speech.") parser.add_argument('--device', type=str, choices=["cpu", "mps","cuda"], default="cpu" if torch.cuda.is_available() else "cpu", help="The device to run the model on.") - + args = parser.parse_args() - + + if not os.path.exists(args.model): + print(f"Model path {args.model} does not exist.") + return 1 + if args.device == "cuda": device="cuda" else: