Spaces:
Running
Running
| # ================================================================================================== | |
| # DEEPFAKE AUDIO - demo_toolbox.py (Legacy Research Interface) | |
| # ================================================================================================== | |
| # | |
| # π DESCRIPTION | |
| # This script launches the original Qt5-based Research Toolbox. While the modern Gradio | |
| # interface is the preferred entry point for general studio use, the Toolbox remains a | |
| # critical asset for in-depth data visualization, cross-dataset exploration, and | |
| # laboratory-grade synthesis auditing. | |
| # | |
| # π€ AUTHORS | |
| # - Amey Thakur (https://github.com/Amey-Thakur) | |
| # - Mega Satish (https://github.com/msatmod) | |
| # | |
| # π€π» CREDITS | |
| # Original Real-Time Voice Cloning methodology by CorentinJ | |
| # Repository: https://github.com/CorentinJ/Real-Time-Voice-Cloning | |
| # | |
| # π PROJECT LINKS | |
| # Repository: https://github.com/Amey-Thakur/DEEPFAKE-AUDIO | |
| # Video Demo: https://youtu.be/i3wnBcbHDbs | |
| # Research: https://github.com/Amey-Thakur/DEEPFAKE-AUDIO/blob/main/DEEPFAKE-AUDIO.ipynb | |
| # | |
| # π LICENSE | |
| # Released under the MIT License | |
| # Release Date: 2021-02-06 | |
| # ================================================================================================== | |
| import argparse | |
| import os | |
| from pathlib import Path | |
| # --- CORE TOOLBOX ENGINE --- | |
| from toolbox import Toolbox | |
| from utils.argutils import print_args | |
| from utils.default_models import ensure_default_models | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser( | |
| description="Runs the toolbox.", | |
| formatter_class=argparse.ArgumentDefaultsHelpFormatter | |
| ) | |
| parser.add_argument("-d", "--datasets_root", type=Path, help= \ | |
| "Path to the directory containing your datasets. See toolbox/__init__.py for a list of " | |
| "supported datasets.", default=None) | |
| parser.add_argument("-m", "--models_dir", type=Path, default="saved_models", | |
| help="Directory containing all saved models") | |
| parser.add_argument("--cpu", action="store_true", help=\ | |
| "If True, all inference will be done on CPU") | |
| parser.add_argument("--seed", type=int, default=None, help=\ | |
| "Optional random number seed value to make toolbox deterministic.") | |
| args = parser.parse_args() | |
| arg_dict = vars(args) | |
| print_args(args, parser) | |
| # Hide GPUs from Pytorch to force CPU processing | |
| if arg_dict.pop("cpu"): | |
| os.environ["CUDA_VISIBLE_DEVICES"] = "-1" | |
| # Remind the user to download pretrained models if needed | |
| ensure_default_models(args.models_dir) | |
| # Launch the toolbox | |
| Toolbox(**arg_dict) | |