diff --git a/DNSMOS/README.md b/DNSMOS/README.md index 5b874478143..8f30a4ebc8b 100644 --- a/DNSMOS/README.md +++ b/DNSMOS/README.md @@ -2,6 +2,16 @@ Human subjective evaluation is the ”gold standard” to evaluate speech quality optimized for human perception. Perceptual objective metrics serve as a proxy for subjective scores. The conventional and widely used metrics require a reference clean speech signal, which is unavailable in real recordings. The no-reference approaches correlate poorly with human ratings and are not widely adopted in the research community. One of the biggest use cases of these perceptual objective metrics is to evaluate noise suppression algorithms. DNSMOS generalizes well in challenging test conditions with a high correlation to human ratings in stack ranking noise suppression methods. More details can be found in [DNSMOS paper](https://arxiv.org/pdf/2010.15258.pdf). +## Set-up instructions (Tested for MAC only, adapt for Windows) +1. Create the virtual environment. You can create anywhere you want, but for the simplicity purpose, create one inside _DNS-Channelge_ directory. +2. `python -m venv dns`, this will create a virtual environment _dns_ by creating a _dns_ directory inside _DNS-Challenge_. +3. Enter the virtual environment: `source dns/bin/activate` +4. Check the version of _pip_ inside the virtual environment and update if necessary. `python -m pip --version`, if needed update pip version: `python -m pip install --upgrade pip`. At the time of writing this, it was pip 24.3.1. + +5. Go to DNSMOS directory: `cd DNSMOS` +6. run: `python install-reqs.py`. This will scan the requirements.txt file and then try to insall all the requirements. If all the requirements are installed successfully, it will print _all packages installed successfully_, otherwise it will print the list of packages failed to install. +7. If everything installed successfully, follow the next steps. + ## Evaluation methodology: Use the **dnsmos_local.py** script. 1. To compute a personalized MOS score (where interfering speaker is penalized) provide the '-p' argument diff --git a/DNSMOS/install-reqs.py b/DNSMOS/install-reqs.py new file mode 100644 index 00000000000..d0298e2f5a7 --- /dev/null +++ b/DNSMOS/install-reqs.py @@ -0,0 +1,27 @@ +import subprocess +# The script reads the requirements.txt file and installs all the packages listed in it using pip. +# If any package fails to install, it will print an error message and continue with the next package. +# Open the requirements.txt file and read all lines +with open('requirements.txt', 'r') as file: + packages = file.readlines() + +failed_packages = [] # List to store the packages that failed to install +# Iterate over each package and install it using pip +for package in packages: + package = package.strip() # Remove any leading/trailing whitespace + if package: # Check if the package name is not empty + try: + subprocess.run(['pip', 'install', package], check=True) # Run the command and check for errors, if any error occurs, it will raise an exception + except subprocess.CalledProcessError as e: + print(f"Error while installing {package}: {e}") + failed_packages.append(package) # Add the package to the failed_packages list +# Print the list of packages that failed to install +if failed_packages: + # Print the list of packages that failed to install + # Print dashed lines to separate the failed packages from the success message + print("-" * 50) + print("Failed to install the following packages:") + for package in failed_packages: + print(package) +else: + print("All packages installed successfully!") # Print a success message if all packages were installed successfully \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d3dc5fa2536..fbed27e7a9a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ onnxruntime==1.13.1 torch==1.10.0 torchvision==0.11.1 torchaudio==0.10.0 +tqdm