sonusai 1.0.6__py3-none-any.whl → 1.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sonusai/__init__.py +1 -1
- sonusai/metrics_summary.py +10 -10
- sonusai/mixture/mixdb.py +1 -1
- {sonusai-1.0.6.dist-info → sonusai-1.0.7.dist-info}/METADATA +1 -1
- {sonusai-1.0.6.dist-info → sonusai-1.0.7.dist-info}/RECORD +7 -8
- sonusai/summarize_metric_spenh.py +0 -65
- {sonusai-1.0.6.dist-info → sonusai-1.0.7.dist-info}/WHEEL +0 -0
- {sonusai-1.0.6.dist-info → sonusai-1.0.7.dist-info}/entry_points.txt +0 -0
sonusai/__init__.py
CHANGED
@@ -16,9 +16,9 @@ commands_doc = """
|
|
16
16
|
genmix Generate mixture and truth data
|
17
17
|
genmixdb Generate a mixture database
|
18
18
|
lsdb List information about a mixture database
|
19
|
+
metrics_summary Summarize generated metrics in a mixture database
|
19
20
|
mkwav Make WAV files from a mixture database
|
20
21
|
onnx_predict Run ONNX predict on a trained model
|
21
|
-
summarize_metric_spenh Summarize speech enhancement and analysis results
|
22
22
|
vars List custom SonusAI variables
|
23
23
|
"""
|
24
24
|
|
sonusai/metrics_summary.py
CHANGED
@@ -90,8 +90,8 @@ def _process_mixture(
|
|
90
90
|
def main() -> None:
|
91
91
|
from docopt import docopt
|
92
92
|
|
93
|
-
from
|
94
|
-
from .utils
|
93
|
+
from sonusai import __version__ as sai_version
|
94
|
+
from sonusai.utils import trim_docstring
|
95
95
|
|
96
96
|
args = docopt(trim_docstring(__doc__), version=sai_version, options_first=True)
|
97
97
|
|
@@ -107,14 +107,14 @@ def main() -> None:
|
|
107
107
|
|
108
108
|
import psutil
|
109
109
|
|
110
|
-
from
|
111
|
-
from
|
112
|
-
from
|
113
|
-
from
|
114
|
-
from .mixture
|
115
|
-
from .utils
|
116
|
-
from .utils
|
117
|
-
from .utils
|
110
|
+
from sonusai import create_file_handler
|
111
|
+
from sonusai import initial_log_messages
|
112
|
+
from sonusai import logger
|
113
|
+
from sonusai import update_console_handler
|
114
|
+
from sonusai.mixture import MixtureDatabase
|
115
|
+
from sonusai.utils import create_timestamp
|
116
|
+
from sonusai.utils import par_track
|
117
|
+
from sonusai.utils import track
|
118
118
|
|
119
119
|
mixdb = MixtureDatabase(location)
|
120
120
|
print(f"Found SonusAI mixture database with {mixdb.num_mixtures} mixtures.")
|
sonusai/mixture/mixdb.py
CHANGED
@@ -2180,7 +2180,7 @@ class MixtureDatabase:
|
|
2180
2180
|
|
2181
2181
|
# Check for metrics dependencies and add them even if not explicitly requested.
|
2182
2182
|
if metric.startswith("mxwer"):
|
2183
|
-
dependencies = ("mxasr." + metric[6:], "
|
2183
|
+
dependencies = ("mxasr." + metric[6:], "sasr." + metric[6:])
|
2184
2184
|
for dependency in dependencies:
|
2185
2185
|
result[dependency] = calc(dependency)
|
2186
2186
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
sonusai/__init__.py,sha256=
|
1
|
+
sonusai/__init__.py,sha256=XSjulPEFTHCTNAte0z0Ie0e-3w9uVX5j5mR9QfE_r40,3710
|
2
2
|
sonusai/aawscd_probwrite.py,sha256=QZLMQrmPr3OjZ06buyYDwlnk9YPCpyr4KHkBjPsiqjU,3700
|
3
3
|
sonusai/audiofe.py,sha256=0DNpntK0WpzNZeyHX8_wC-pDtrgvLkJZFPXz-PspdrY,19448
|
4
4
|
sonusai/calc_metric_spenh.py,sha256=0Md6hRFUH9lGnsvoydqne99O7Gi0ieG9vMU_1PnASBg,50019
|
@@ -44,7 +44,7 @@ sonusai/metrics/class_summary.py,sha256=mQbMxQ8EtFIN7S2h7A4Dk0X4XF_CIxKk3W8zZMmp
|
|
44
44
|
sonusai/metrics/confusion_matrix_summary.py,sha256=lhd8TyHVMC03khX85h_D75XElmawx56KkqpX3X2O2gQ,3133
|
45
45
|
sonusai/metrics/one_hot.py,sha256=aKc-xYd4zWIjbmoQikIcQ6BJB1k-68XKTg8eJCacHTU,13906
|
46
46
|
sonusai/metrics/snr_summary.py,sha256=qKHctpmvGeu2cmjTG7iQPX1lvVUEtEnCIKwUGu6VrEQ,5773
|
47
|
-
sonusai/metrics_summary.py,sha256=
|
47
|
+
sonusai/metrics_summary.py,sha256=pQ5kNwweQM6LdP6TpJE7kV3Z9BYUd96IfEjnZLfSpQI,12211
|
48
48
|
sonusai/mixture/__init__.py,sha256=_vepE2uhAGKHIujPWxfGDeaWHP5yKLf5BjXkU9ZereA,1258
|
49
49
|
sonusai/mixture/audio.py,sha256=JyrVtVPLH3aTXFgyl446f5uVHxlFRa4aBaSPYaMdg80,5814
|
50
50
|
sonusai/mixture/class_balancing.py,sha256=lubicVCzxs4TMh2dZSsuIffkLkk1gmwjmwtrtQ27BVQ,3638
|
@@ -59,7 +59,7 @@ sonusai/mixture/helpers.py,sha256=dmyHwf1C5dZjYOd11kVV16KI33CaM-dU_fyaxOrrKt8,11
|
|
59
59
|
sonusai/mixture/ir_delay.py,sha256=aiC23HMWQ08-v5wORgMx1_DOJSdh4kunULqiQ-SGuMo,2026
|
60
60
|
sonusai/mixture/ir_effects.py,sha256=PqiqD4PS42-7kD6ESnsZi2a3tnKCFa4E0xqUujRBvGg,2152
|
61
61
|
sonusai/mixture/log_duration_and_sizes.py,sha256=3ekS27IMKlnxIkQAmprzmBnzHOpRjZh3d7maL2VqWQU,927
|
62
|
-
sonusai/mixture/mixdb.py,sha256=
|
62
|
+
sonusai/mixture/mixdb.py,sha256=zGFagqRIV9uX2QiP795lyN29AarGnZgeKTdUIBcuyfY,86305
|
63
63
|
sonusai/mixture/pad_audio.py,sha256=KNxVQAejA0hblLOnMJgLS6lFaeE0n3tWQ5rclaHBnIY,1015
|
64
64
|
sonusai/mixture/resample.py,sha256=jXqH6FrZ0mlhQ07XqPx88TT9elu3HHVLw7Q0a7Lh5M4,221
|
65
65
|
sonusai/mixture/sox_effects.py,sha256=tndS9qrh3eJOTUPrufyWHCt3UqjbPuh81I4Lo4MNmDg,5328
|
@@ -88,7 +88,6 @@ sonusai/speech/timit.py,sha256=73T1eOQcA1FfvpCGN8gC4iP56vt4KWcDjLnlkVgdZ9U,4099
|
|
88
88
|
sonusai/speech/types.py,sha256=4eKVPAktpkIrZ2qoVp2iT45zxTVNocQEGT6O_Zlub_w,214
|
89
89
|
sonusai/speech/vctk.py,sha256=WInvRRRkZCW6t_NcZAJffJzgCbyetal-j2w0kKX5SDw,1527
|
90
90
|
sonusai/speech/voxceleb.py,sha256=Uu1kB1krf8hess1yuvGbYfV_VgYhklEyoz4I7KfrVpw,2658
|
91
|
-
sonusai/summarize_metric_spenh.py,sha256=Zha0PZGZ_NznPeHh8rjVIaWR7ac4MEIlijci1uikiT0,1870
|
92
91
|
sonusai/utils/__init__.py,sha256=4XB-62-4Dg_XgZ6Ip2fEOBJ0_oQff6jndYl2rlzl6XE,2699
|
93
92
|
sonusai/utils/asl_p56.py,sha256=zH82RI7h399ZYFOOiOC35iv_qi0KhXpmG5uItWB8n78,3854
|
94
93
|
sonusai/utils/asr.py,sha256=w5xSBpA2wibzsiCWzdSm1m3LwNd54dcJMMLBWN33FJs,2818
|
@@ -132,7 +131,7 @@ sonusai/utils/tokenized_shell_vars.py,sha256=EDrrAgz5lJ0RBAjLcTJt1MeyjhbNZiqXkym
|
|
132
131
|
sonusai/utils/write_audio.py,sha256=IHzrJoFtFcea_J6wo6QSiojRkgnNOzAEcg-z0rFV7nU,810
|
133
132
|
sonusai/utils/yes_or_no.py,sha256=0h1okjXmDNbJp7rZJFR2V-HFU1GJDm3YFTUVmYExkOU,263
|
134
133
|
sonusai/vars.py,sha256=m8pdgfR4A6A9TCGf_rok6jPAT5BgrEsYXTSISIh1nrI,1163
|
135
|
-
sonusai-1.0.
|
136
|
-
sonusai-1.0.
|
137
|
-
sonusai-1.0.
|
138
|
-
sonusai-1.0.
|
134
|
+
sonusai-1.0.7.dist-info/METADATA,sha256=eyPTvxuqs2NwuNq2Rp5JsQOeCCZxol44M6EIWlxW3Ng,2652
|
135
|
+
sonusai-1.0.7.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
136
|
+
sonusai-1.0.7.dist-info/entry_points.txt,sha256=zMNjEphEPO6B3cD1GNpit7z-yA9tUU5-j3W2v-UWstU,92
|
137
|
+
sonusai-1.0.7.dist-info/RECORD,,
|
@@ -1,65 +0,0 @@
|
|
1
|
-
"""sonusai summarize_metric_spenh
|
2
|
-
|
3
|
-
usage: summarize_metric_spenh [-hr] [-s SORT] LOC
|
4
|
-
|
5
|
-
options:
|
6
|
-
-h, --help
|
7
|
-
-s SORT, --sort SORT Sort by SORT column. [default: MIXID]
|
8
|
-
-r, --reverse Reverse sort order.
|
9
|
-
|
10
|
-
Summarize speech enhancement metrics results using data generated by SonusAI calc_metric_spenh.
|
11
|
-
|
12
|
-
Inputs:
|
13
|
-
LOC A SonusAI calc_metric_spenh results directory.
|
14
|
-
|
15
|
-
"""
|
16
|
-
|
17
|
-
|
18
|
-
def summarize_metric_spenh(location: str, by: str = "MIXID", reverse: bool = False) -> str:
|
19
|
-
import glob
|
20
|
-
|
21
|
-
import pandas as pd
|
22
|
-
|
23
|
-
files = sorted(glob.glob(location + "/*_metric_spenh.txt"))
|
24
|
-
need_header = True
|
25
|
-
header = ["MIXID"]
|
26
|
-
data = []
|
27
|
-
for file in files:
|
28
|
-
with open(file) as f:
|
29
|
-
for i, line in enumerate(f):
|
30
|
-
if i == 1 and need_header:
|
31
|
-
need_header = False
|
32
|
-
header.extend(line.strip().split())
|
33
|
-
elif i == 2:
|
34
|
-
data.append(line.strip().split())
|
35
|
-
break
|
36
|
-
|
37
|
-
df = pd.DataFrame(data, columns=header) # pyright: ignore [reportArgumentType]
|
38
|
-
df[header[0:-2]] = df[header[0:-2]].apply(pd.to_numeric, errors="coerce")
|
39
|
-
return df.sort_values(by=by, ascending=not reverse).to_string(index=False)
|
40
|
-
|
41
|
-
|
42
|
-
def main():
|
43
|
-
from docopt import docopt
|
44
|
-
|
45
|
-
from sonusai import __version__ as sai_version
|
46
|
-
from sonusai.utils import trim_docstring
|
47
|
-
|
48
|
-
args = docopt(trim_docstring(__doc__), version=sai_version, options_first=True)
|
49
|
-
|
50
|
-
by = args["--sort"]
|
51
|
-
reverse = args["--reverse"]
|
52
|
-
location = args["LOC"]
|
53
|
-
|
54
|
-
print(summarize_metric_spenh(location, by, reverse))
|
55
|
-
|
56
|
-
|
57
|
-
if __name__ == "__main__":
|
58
|
-
from sonusai import exception_handler
|
59
|
-
from sonusai.utils import register_keyboard_interrupt
|
60
|
-
|
61
|
-
register_keyboard_interrupt()
|
62
|
-
try:
|
63
|
-
main()
|
64
|
-
except Exception as e:
|
65
|
-
exception_handler(e)
|
File without changes
|
File without changes
|