From 12a5f426efcb4cf4b42e20186d679ac0d249ab92 Mon Sep 17 00:00:00 2001 From: FBurkhardt Date: Thu, 27 Jun 2024 15:13:10 +0200 Subject: [PATCH] update --- CHANGELOG.md | 5 +++++ nkululeko/constants.py | 2 +- nkululeko/demo_predictor.py | 6 ++++-- nkululeko/reporting/reporter.py | 4 ++-- tests/exp_emodb-aug_os_xgb.ini | 2 ++ tests/exp_emodb_os_mlp.ini | 2 +- tests/exp_emodb_os_xgb.ini | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90b8f131..ca95dd0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +Version 0.88.3 +-------------- +* fixed bug in false uncertainty estimation +* changed demo live recording + Version 0.88.2 -------------- * changed combine speaker results to show speakers not samples diff --git a/nkululeko/constants.py b/nkululeko/constants.py index 7c6b4cfb..783a4a34 100644 --- a/nkululeko/constants.py +++ b/nkululeko/constants.py @@ -1,2 +1,2 @@ -VERSION="0.88.2" +VERSION="0.88.3" SAMPLING_RATE = 16000 diff --git a/nkululeko/demo_predictor.py b/nkululeko/demo_predictor.py index d6e38cfe..006bbd9b 100644 --- a/nkululeko/demo_predictor.py +++ b/nkululeko/demo_predictor.py @@ -72,9 +72,11 @@ def run_demo(self): else: self.util.debug(df_res) else: - while True: + answer = input("want to record y/n?") + while answer == "y": signal = self.record_audio(3) self.predict_signal(signal, self.sr) + answer = input("want to record y/n?") # self.play_audio(signal) @@ -109,7 +111,7 @@ def predict_signal(self, signal, sr): def record_audio(self, seconds): import sounddevice as sd - print("recording ...") + print("recording ...", flush=True) y = sd.rec(int(seconds * self.sr), samplerate=self.sr, channels=1) sd.wait() y = y.T diff --git a/nkululeko/reporting/reporter.py b/nkululeko/reporting/reporter.py index 33334bd2..1f3dab0d 100644 --- a/nkululeko/reporting/reporter.py +++ b/nkululeko/reporting/reporter.py @@ -144,10 +144,10 @@ def print_probabilities(self): and "uncertainty" not in self.probas ): probas = self.probas - probas["predicted"] = self.preds - probas["truth"] = self.truths # softmax the probabilities or logits uncertainty = probas.apply(softmax, axis=1) + probas["predicted"] = self.preds + probas["truth"] = self.truths try: le = glob_conf.label_encoder mapping = dict(zip(le.classes_, range(len(le.classes_)))) diff --git a/tests/exp_emodb-aug_os_xgb.ini b/tests/exp_emodb-aug_os_xgb.ini index a11fd121..b8e760b8 100644 --- a/tests/exp_emodb-aug_os_xgb.ini +++ b/tests/exp_emodb-aug_os_xgb.ini @@ -17,6 +17,8 @@ augmented.split_strategy = train emodb.mapping = {'anger':'angry', 'happiness':'happy', 'sadness':'sad', 'neutral':'neutral'} labels = ['angry', 'happy', 'neutral', 'sad'] target = emotion +[AUGMENT] +augment = ['traditional'] [FEATS] type = ['os'] scale = standard diff --git a/tests/exp_emodb_os_mlp.ini b/tests/exp_emodb_os_mlp.ini index dae05440..ff060f6e 100644 --- a/tests/exp_emodb_os_mlp.ini +++ b/tests/exp_emodb_os_mlp.ini @@ -11,7 +11,7 @@ emodb.split_strategy = specified emodb.test_tables = ['emotion.categories.test.gold_standard'] emodb.train_tables = ['emotion.categories.train.gold_standard'] target = emotion -labels = ['anger', 'happiness', 'sadness', 'fear'] +labels = ['anger', 'happiness'] #no_reuse = True [FEATS] type = ['os'] diff --git a/tests/exp_emodb_os_xgb.ini b/tests/exp_emodb_os_xgb.ini index 398ad013..bfdf5a4e 100644 --- a/tests/exp_emodb_os_xgb.ini +++ b/tests/exp_emodb_os_xgb.ini @@ -17,7 +17,7 @@ target = emotion type = ['os'] store_format = csv scale = standard -no_reuse = True +#no_reuse = True [MODEL] type = xgb [PLOT]