-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from sensein/enh/organize
Generate feature file (and other fixes)
- Loading branch information
Showing
3 changed files
with
280 additions
and
158 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import click | ||
|
||
from .process import to_features, verify_speaker_from_files | ||
|
||
|
||
@click.command() | ||
@click.group() | ||
def main(): | ||
"""Example script.""" | ||
click.echo("Will process some files later") | ||
pass | ||
|
||
|
||
@main.command() | ||
@click.argument("filename", type=click.Path(exists=True)) | ||
@click.argument("subject", type=str) | ||
@click.argument("task", type=str) | ||
@click.option("--outdir", type=click.Path(), default=os.getcwd(), show_default=True) | ||
@click.option("--n_mels", type=int, default=20, show_default=True) | ||
@click.option("--n_coeff", type=int, default=20, show_default=True) | ||
@click.option("--compute_deltas/--no-compute_deltas", default=True, show_default=True) | ||
def convert(filename, subject, task, outdir, n_mels, n_coeff, compute_deltas): | ||
to_features( | ||
filename, | ||
subject, | ||
task, | ||
outdir=Path(outdir), | ||
n_mels=n_mels, | ||
n_coeff=n_coeff, | ||
compute_deltas=compute_deltas, | ||
) | ||
|
||
|
||
@main.command() | ||
@click.argument("file1", type=click.Path(exists=True)) | ||
@click.argument("file2", type=click.Path(exists=True)) | ||
@click.argument("model", type=str) | ||
def verify(file1, file2, model): | ||
score, prediction = verify_speaker_from_files(file1, file2, model=model) | ||
print(f"Score: {float(score):.2f} Prediction: {bool(prediction)}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters