sonusai 1.0.7__py3-none-any.whl → 1.0.8__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 +8 -7
- sonusai/audiofe.py +1 -1
- sonusai/calc_metric_spenh.py +9 -9
- sonusai/genft.py +1 -1
- sonusai/genmetrics.py +3 -3
- sonusai/genmix.py +1 -1
- sonusai/genmixdb.py +1 -1
- sonusai/metrics_summary.py +7 -8
- sonusai/mkwav.py +1 -1
- sonusai/onnx_predict.py +1 -1
- {sonusai-1.0.7.dist-info → sonusai-1.0.8.dist-info}/METADATA +1 -1
- {sonusai-1.0.7.dist-info → sonusai-1.0.8.dist-info}/RECORD +14 -14
- {sonusai-1.0.7.dist-info → sonusai-1.0.8.dist-info}/WHEEL +0 -0
- {sonusai-1.0.7.dist-info → sonusai-1.0.8.dist-info}/entry_points.txt +0 -0
sonusai/__init__.py
CHANGED
@@ -36,7 +36,7 @@ logger_db = logging.getLogger("sonusai_db")
|
|
36
36
|
logger_db.setLevel(logging.DEBUG)
|
37
37
|
|
38
38
|
# create file handler
|
39
|
-
def create_file_handler(filename: str) -> None:
|
39
|
+
def create_file_handler(filename: str, verbose: bool = False) -> None:
|
40
40
|
from pathlib import Path
|
41
41
|
|
42
42
|
fh = logging.FileHandler(filename=filename, mode="w")
|
@@ -44,12 +44,13 @@ def create_file_handler(filename: str) -> None:
|
|
44
44
|
fh.setFormatter(formatter)
|
45
45
|
logger.addHandler(fh)
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
if verbose:
|
48
|
+
filename_db = Path(filename)
|
49
|
+
filename_db = filename_db.parent / (filename_db.stem + "_dbtrace" + filename_db.suffix)
|
50
|
+
fh = logging.FileHandler(filename=filename_db, mode="w")
|
51
|
+
fh.setLevel(logging.DEBUG)
|
52
|
+
fh.setFormatter(formatter_db)
|
53
|
+
logger_db.addHandler(fh)
|
53
54
|
|
54
55
|
|
55
56
|
# update console handler
|
sonusai/audiofe.py
CHANGED
sonusai/calc_metric_spenh.py
CHANGED
@@ -531,10 +531,10 @@ def _process_mixture(
|
|
531
531
|
pesq_speech = calc_pesq(target_est_wav, target_fi)
|
532
532
|
csig_tg, cbak_tg, covl_tg = calc_speech(target_est_wav, target_fi, pesq=pesq_speech)
|
533
533
|
metrics = mixdb.mixture_metrics(m_id, ["mxpesq", "mxcsig", "mxcbak", "mxcovl"])
|
534
|
-
pesq_mx = metrics["mxpesq"][
|
535
|
-
csig_mx = metrics["mxcsig"][
|
536
|
-
cbak_mx = metrics["mxcbak"][
|
537
|
-
covl_mx = metrics["mxcovl"][
|
534
|
+
pesq_mx = metrics["mxpesq"]["primary"] if isinstance(metrics["mxpesq"], dict) else metrics["mxpesq"]
|
535
|
+
csig_mx = metrics["mxcsig"]["primary"] if isinstance(metrics["mxcsig"], dict) else metrics["mxcsig"]
|
536
|
+
cbak_mx = metrics["mxcbak"]["primary"] if isinstance(metrics["mxcbak"], dict) else metrics["mxcbak"]
|
537
|
+
covl_mx = metrics["mxcovl"]["primary"] if isinstance(metrics["mxcovl"], dict) else metrics["mxcovl"]
|
538
538
|
# pesq_speech_tst = calc_pesq(hypothesis=target_est_wav, reference=target)
|
539
539
|
# pesq_mixture_tst = calc_pesq(hypothesis=mixture, reference=target)
|
540
540
|
# pesq improvement
|
@@ -560,11 +560,11 @@ def _process_mixture(
|
|
560
560
|
if asr_method is not None and mixdb.mixture(m_id).noise.snr >= -96: # noise only, ignore/reset target ASR
|
561
561
|
asr_mx_name = f"mxasr.{asr_method}"
|
562
562
|
wer_mx_name = f"mxwer.{asr_method}"
|
563
|
-
asr_tt_name = f"
|
563
|
+
asr_tt_name = f"sasr.{asr_method}"
|
564
564
|
metrics = mixdb.mixture_metrics(m_id, [asr_mx_name, wer_mx_name, asr_tt_name])
|
565
|
-
asr_mx = metrics[asr_mx_name][
|
566
|
-
wer_mx = metrics[wer_mx_name][
|
567
|
-
asr_tt = metrics[asr_tt_name][
|
565
|
+
asr_mx = metrics[asr_mx_name]["primary"] if isinstance(metrics[asr_mx_name], dict) else metrics[asr_mx_name]
|
566
|
+
wer_mx = metrics[wer_mx_name]["primary"] if isinstance(metrics[wer_mx_name], dict) else metrics[wer_mx_name]
|
567
|
+
asr_tt = metrics[asr_tt_name]["primary"] if isinstance(metrics[asr_tt_name], dict) else metrics[asr_tt_name]
|
568
568
|
|
569
569
|
if asr_tt:
|
570
570
|
noiseadd = None # TBD add as switch, default -30
|
@@ -849,7 +849,7 @@ def main():
|
|
849
849
|
logger.info(f"Found predict log {basename(predict_logfile[0])} in predict location.")
|
850
850
|
|
851
851
|
# Setup logging file
|
852
|
-
create_file_handler(join(predict_location, "calc_metric_spenh.log"))
|
852
|
+
create_file_handler(join(predict_location, "calc_metric_spenh.log"), verbose)
|
853
853
|
update_console_handler(verbose)
|
854
854
|
initial_log_messages("calc_metric_spenh")
|
855
855
|
|
sonusai/genft.py
CHANGED
sonusai/genmetrics.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
"""sonusai genmetrics
|
2
2
|
|
3
|
-
usage: genmetrics [-hvusd] [-i MIXID] [-n INCLUDE] [-
|
3
|
+
usage: genmetrics [-hvusd] [-i MIXID] [-n INCLUDE] [-x EXCLUDE] [-p NUMPROC] LOC
|
4
4
|
|
5
5
|
options:
|
6
6
|
-h, --help
|
7
7
|
-v, --verbose Be verbose.
|
8
8
|
-i MIXID, --mixid MIXID Mixture ID(s) to generate. [default: *].
|
9
9
|
-n INCLUDE, --include INCLUDE Metrics to include. [default: all]
|
10
|
-
-p NUMPROC, --nproc NUMPROC Number of parallel processes to use. Default single thread.
|
11
10
|
-x EXCLUDE, --exclude EXCLUDE Metrics to exclude. [default: none]
|
11
|
+
-p NUMPROC, --nproc NUMPROC Number of parallel processes to use. Default single thread.
|
12
12
|
-u, --update Update metrics (do not regenerate existing metrics).
|
13
13
|
-s, --supported Show list of supported metrics.
|
14
14
|
-d, --dryrun Show list of metrics that will be generated and exit.
|
@@ -97,7 +97,7 @@ def main() -> None:
|
|
97
97
|
start_time = time.monotonic()
|
98
98
|
|
99
99
|
# Setup logging file
|
100
|
-
create_file_handler(join(location, "genmetrics.log"))
|
100
|
+
create_file_handler(join(location, "genmetrics.log"), verbose)
|
101
101
|
update_console_handler(verbose)
|
102
102
|
initial_log_messages("genmetrics")
|
103
103
|
|
sonusai/genmix.py
CHANGED
@@ -144,7 +144,7 @@ def main() -> None:
|
|
144
144
|
|
145
145
|
start_time = time.monotonic()
|
146
146
|
|
147
|
-
create_file_handler(join(location, "genmix.log"))
|
147
|
+
create_file_handler(join(location, "genmix.log"), verbose)
|
148
148
|
update_console_handler(verbose)
|
149
149
|
initial_log_messages("genmix")
|
150
150
|
|
sonusai/genmixdb.py
CHANGED
@@ -314,7 +314,7 @@ def main() -> None:
|
|
314
314
|
|
315
315
|
makedirs(location, exist_ok=True)
|
316
316
|
|
317
|
-
create_file_handler(join(location, "genmixdb.log"))
|
317
|
+
create_file_handler(join(location, "genmixdb.log"), verbose)
|
318
318
|
update_console_handler(verbose)
|
319
319
|
initial_log_messages("genmixdb")
|
320
320
|
|
sonusai/metrics_summary.py
CHANGED
@@ -55,13 +55,13 @@ def _process_mixture(
|
|
55
55
|
|
56
56
|
all_metrics = mixdb.mixture_metrics(m_id, all_metric_names)
|
57
57
|
|
58
|
-
# replace
|
58
|
+
# replace dict with 'primary' value (ignore mixup)
|
59
59
|
scalar_metrics = {
|
60
|
-
key: all_metrics[key][
|
60
|
+
key: all_metrics[key]["primary"] if isinstance(all_metrics[key], dict) else all_metrics[key]
|
61
61
|
for key in scalar_metric_names
|
62
62
|
}
|
63
63
|
string_metrics = {
|
64
|
-
key: all_metrics[key][
|
64
|
+
key: all_metrics[key]["primary"] if isinstance(all_metrics[key], dict) else all_metrics[key]
|
65
65
|
for key in string_metric_names
|
66
66
|
}
|
67
67
|
|
@@ -133,7 +133,7 @@ def main() -> None:
|
|
133
133
|
timestamp = create_timestamp() # string good for embedding into filenames
|
134
134
|
mixdb_fname = basename(location)
|
135
135
|
if verbose:
|
136
|
-
create_file_handler(join(location, "metrics_summary.log"))
|
136
|
+
create_file_handler(join(location, "metrics_summary.log"), verbose)
|
137
137
|
update_console_handler(verbose)
|
138
138
|
initial_log_messages("metrics_summary")
|
139
139
|
logger.info(f"Logging summary of SonusAI mixture database at {location}")
|
@@ -168,10 +168,9 @@ def main() -> None:
|
|
168
168
|
for metric in metrics_present:
|
169
169
|
metval = all_metrics[metric] # get metric value
|
170
170
|
logger.debug(f"First mixid {mixids[0]} metric {metric} = {metval}")
|
171
|
-
if isinstance(metval,
|
172
|
-
|
173
|
-
|
174
|
-
metval = metval[0] # remove any list
|
171
|
+
if isinstance(metval, dict):
|
172
|
+
logger.warning(f"Mixid {mixids[0]} metric {metric} is a dict, using 'primary'.")
|
173
|
+
metval = metval["primary"] # remove any dict
|
175
174
|
if isinstance(metval, float | int):
|
176
175
|
logger.debug(f"Metric is scalar {type(metval)}, entering in summary table.")
|
177
176
|
scalar_metric_names.append(metric)
|
sonusai/mkwav.py
CHANGED
sonusai/onnx_predict.py
CHANGED
@@ -210,7 +210,7 @@ def main() -> None:
|
|
210
210
|
if mixdb_path is not None or len(pfiles) > 1: # log file only if mixdb or more than one file
|
211
211
|
makedirs(output_dir, exist_ok=True)
|
212
212
|
# Setup logging file
|
213
|
-
create_file_handler(join(output_dir, "onnx-predict.log"))
|
213
|
+
create_file_handler(join(output_dir, "onnx-predict.log"), verbose)
|
214
214
|
update_console_handler(verbose)
|
215
215
|
initial_log_messages("onnx_predict")
|
216
216
|
# print some previous messages
|
@@ -1,7 +1,7 @@
|
|
1
|
-
sonusai/__init__.py,sha256=
|
1
|
+
sonusai/__init__.py,sha256=uIuqSf_XWSVHTj4Q7bfJaO7uK1C25XpSK90DWMRKyx4,3773
|
2
2
|
sonusai/aawscd_probwrite.py,sha256=QZLMQrmPr3OjZ06buyYDwlnk9YPCpyr4KHkBjPsiqjU,3700
|
3
|
-
sonusai/audiofe.py,sha256=
|
4
|
-
sonusai/calc_metric_spenh.py,sha256=
|
3
|
+
sonusai/audiofe.py,sha256=un6fbS1fHWo9rpgRYG6SdBjaCWuxLkDKtg6N_ZkC1dk,19457
|
4
|
+
sonusai/calc_metric_spenh.py,sha256=UW4ItryjYgb4NHkwki9LHvyDBwdIHIARc1yT6yCPJno,50084
|
5
5
|
sonusai/config/__init__.py,sha256=NeXdBQiuRKIm77pK9WHaxkdst9-jwhX1IDrHvpZecpI,52
|
6
6
|
sonusai/config/config.py,sha256=nM1W7dQXBWMdMLrgh3o7_cEItztFf1UTW-4faM0hIqY,1692
|
7
7
|
sonusai/config/config.yml,sha256=9y8wWXemU8tnvm_O21treyCpZF85QzokHsHQ8yl6IfE,283
|
@@ -20,10 +20,10 @@ sonusai/deprecated/tplot.py,sha256=0p238DvTaP4oU9y-dp0JdLaTV4TKrooAwbx7zdz_QAc,1
|
|
20
20
|
sonusai/doc/__init__.py,sha256=KyQ26Um0RM8A3GYsb_tbFH64RwpoAw6lja2f_moUWas,33
|
21
21
|
sonusai/doc/doc.py,sha256=vyEfiUNd--F14Eel-u1EY4mfvHUXJrGrV3xKKExUiC4,19272
|
22
22
|
sonusai/doc.py,sha256=ZgFSSI56oNDb-yC3xi-RHMClMjryR2VrgGyi3ggX8gM,1098
|
23
|
-
sonusai/genft.py,sha256=
|
24
|
-
sonusai/genmetrics.py,sha256=
|
25
|
-
sonusai/genmix.py,sha256=
|
26
|
-
sonusai/genmixdb.py,sha256=
|
23
|
+
sonusai/genft.py,sha256=yiADvi0J-Fy4kNpNOEB3wVvU9RZowGvOsCTJndQYXFw,5580
|
24
|
+
sonusai/genmetrics.py,sha256=9l7g_DAKa126RGq23-Wilzdh1M3QHCCeNfUVYaQS1mU,6193
|
25
|
+
sonusai/genmix.py,sha256=gcmqcPqZ1Vz_TtZMp29L8cGnqTK5jcw0cAOc16NOR9A,5753
|
26
|
+
sonusai/genmixdb.py,sha256=VDQMF6JHcHc-yJAZ1Se3CM3ac8fFKIgnaxv4e5jdE1I,11281
|
27
27
|
sonusai/ir_metric.py,sha256=nxS_mARPSZG5Y0G3L8HysOnkPj4v-RGxAxAVBYe-gJI,19600
|
28
28
|
sonusai/lsdb.py,sha256=86t6PpsyardRa6VcSJ-KyU1NiTmlg59VUlcSTptJbn0,5078
|
29
29
|
sonusai/main.py,sha256=72feJv5XEVJE_CQatmNIL1VD9ca-Mo0QNDbXxLrHrbQ,2619
|
@@ -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=jtSwHomw23qwTYfzjFo_JmqzrkZcts1CMFFzTmJCmWk,12189
|
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
|
@@ -75,8 +75,8 @@ sonusai/mixture/truth_functions/metrics.py,sha256=Mu6o4Hf-I0-f-dVA_egFBUvf1OBj5v
|
|
75
75
|
sonusai/mixture/truth_functions/phoneme.py,sha256=PhSev7PNDOECcdjnCwiISDZlXQwAiOdk_hD0p3eoXN4,763
|
76
76
|
sonusai/mixture/truth_functions/sed.py,sha256=bMYHLBNPfzo4K-22_iGNi2NwDAG82vNtlDioA8VqcOo,3750
|
77
77
|
sonusai/mixture/truth_functions/target.py,sha256=06zNRu4aD7TReZiaq0HQgukqOrYr1sDgYhHCTIPV1Es,4913
|
78
|
-
sonusai/mkwav.py,sha256=
|
79
|
-
sonusai/onnx_predict.py,sha256=
|
78
|
+
sonusai/mkwav.py,sha256=CExhCtnCvWm2pOS0JW_1FL0Te63JC_WbgA78tS4GB1Q,4200
|
79
|
+
sonusai/onnx_predict.py,sha256=w_gyvxWlDIxj0ySG3c1y8bMV7xlPb-ecVUtun_LInms,15781
|
80
80
|
sonusai/queries/__init__.py,sha256=gB7mgKVg8nIIgH-M1Oivoxkc3TGieOlIFzRHMwBQmrY,277
|
81
81
|
sonusai/queries/queries.py,sha256=HLbwbd7OSXKO-IH6LxKzpr98_vfNlNQXIKZSUvQ98lw,7702
|
82
82
|
sonusai/speech/__init__.py,sha256=vqAymCBPjMUSM4OZKHTai6BYwXsOBlf_G_vOhELVf8I,133
|
@@ -131,7 +131,7 @@ sonusai/utils/tokenized_shell_vars.py,sha256=EDrrAgz5lJ0RBAjLcTJt1MeyjhbNZiqXkym
|
|
131
131
|
sonusai/utils/write_audio.py,sha256=IHzrJoFtFcea_J6wo6QSiojRkgnNOzAEcg-z0rFV7nU,810
|
132
132
|
sonusai/utils/yes_or_no.py,sha256=0h1okjXmDNbJp7rZJFR2V-HFU1GJDm3YFTUVmYExkOU,263
|
133
133
|
sonusai/vars.py,sha256=m8pdgfR4A6A9TCGf_rok6jPAT5BgrEsYXTSISIh1nrI,1163
|
134
|
-
sonusai-1.0.
|
135
|
-
sonusai-1.0.
|
136
|
-
sonusai-1.0.
|
137
|
-
sonusai-1.0.
|
134
|
+
sonusai-1.0.8.dist-info/METADATA,sha256=UABc8ZNaqTCnFNoOgmRokBRF9G7RI58MDP1B081075c,2652
|
135
|
+
sonusai-1.0.8.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
136
|
+
sonusai-1.0.8.dist-info/entry_points.txt,sha256=zMNjEphEPO6B3cD1GNpit7z-yA9tUU5-j3W2v-UWstU,92
|
137
|
+
sonusai-1.0.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|