Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth set-up instructions #196

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions DNSMOS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions DNSMOS/install-reqs.py
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ onnxruntime==1.13.1
torch==1.10.0
torchvision==0.11.1
torchaudio==0.10.0
tqdm