-
Notifications
You must be signed in to change notification settings - Fork 31
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 #37 from k2kobayashi/results
- modify result calculation
- Loading branch information
Showing
9 changed files
with
104 additions
and
31 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# vim:fenc=utf-8 | ||
# | ||
# Copyright (c) 2021 Kazuhiro KOBAYASHI <[email protected]> | ||
# | ||
# Distributed under terms of the MIT license. | ||
|
||
""" | ||
""" | ||
|
||
import argparse | ||
from pathlib import Path | ||
|
||
|
||
def main(): | ||
# options for python | ||
description = "Rename decoded waveforms" | ||
parser = argparse.ArgumentParser(description=description) | ||
parser.add_argument("--outwavdir", type=str, help="decoded waveform directory") | ||
args = parser.parse_args() | ||
decoded_files = Path(args.outwavdir).glob("*.wav") | ||
|
||
for f in decoded_files: | ||
stem = str(f.stem).rstrip("_gen") | ||
org = stem.split("org")[1].split("cv")[0].lstrip("-").rstrip("_") | ||
(f.parent / org).mkdir(exist_ok=True, parents=True) | ||
f.rename((f.parent / org / (stem + ".wav"))) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# vcc2018v1: mlfb_vqvae.conf | ||
- mcd | ||
- 9.54667 | ||
- mosnet | ||
- 3.42398 | ||
--- | ||
# vcc2018v1: mlfb_cycle.conf | ||
- mcd | ||
- 9.44014 | ||
- mosnet | ||
- 3.46762 | ||
--- |
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ torch-optimizer | |
pytorch_lamb | ||
tensorflow-gpu==2.4.0 | ||
gdown | ||
museval |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /bin/bash | ||
# | ||
# generate_results.sh | ||
# Copyright (C) 2020 Kazuhiro KOBAYASHI <[email protected]> | ||
# | ||
# Distributed under terms of the MIT license. | ||
# | ||
|
||
# shellcheck disable=SC1091 | ||
. ./path.sh || exit 1 | ||
|
||
. utils/parse_options.sh || exit 1; | ||
|
||
conf=$1 | ||
voc_expdir=$2 | ||
# check arguments | ||
if [ $# -lt 2 ]; then | ||
echo "Usage: $0 <conf>" | ||
exit 1 | ||
fi | ||
|
||
set -eu | ||
|
||
# shellcheck disable=SC2012 | ||
recipe=$(basename "$PWD") | ||
confname=$(basename "${conf}" .yml) | ||
voc_confname=$(basename "${voc_expdir}") | ||
PWG_dir=exp/${confname}/eval_${voc_confname}_wav | ||
# shellcheck disable=SC2012 | ||
result_dir=$PWG_dir/$(basename "$(ls -dt "${PWG_dir}"/* | head -1)") | ||
|
||
mcd=$(head -n -2 < "$result_dir"/mcd.log | tac | head -n -4 | tac | awk '{if($1!=$2) print $1, $2, $3}' | awk '{sum+=$3} END {print sum/NR}') | ||
mosnet=$(head -n -2 "$result_dir"/mosnet.log | tac | head -n -8 | tac | awk '{if($1!=$2) print $1, $2, $3}' | awk '{sum+=$3} END {print sum/NR}') | ||
echo "# $recipe: $confname.conf" | ||
echo "- mcd" | ||
echo " - $mcd" | ||
echo "- mosnet" | ||
echo " - $mosnet" | ||
echo "---" |