From 480ae1fb8f5404b99b0b51b6739b3cc47b5d915e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kara=C5=9B?= <s176030@student.pg.edu.pl> Date: Wed, 9 Nov 2022 09:32:44 +0100 Subject: [PATCH] add logging instance in test_AFE.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Damian KaraĹ <s176030@student.pg.edu.pl> --- .gitignore | 8 +++++++- test_AFE.py | 6 +++++- utils/AFE/process_audio.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 13607af..d18bc7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,13 @@ CQFB_F_min=50_FB_smooth=delay_CMPO_smooth=none_FB2CMPO_sr=1.00_F_max=1050_K=20_q=2.00_Fs=8000.mat +test_results/ requirements.txt.bak requirements.txt.old run_IFE_infer_call.bat.bak run_train_model_call.bat.bak *.pyc -*.log \ No newline at end of file +*.log +*.wav +*.dat +*.mat +*.asv +*.entropy \ No newline at end of file diff --git a/test_AFE.py b/test_AFE.py index 924e34e..013cf07 100644 --- a/test_AFE.py +++ b/test_AFE.py @@ -2,6 +2,7 @@ from timeit import default_timer as timer import logging from data_processor.dataset.ife_dataset import IFEDataset +from utils.log_config import LogConfig from vowel_synthesis.vowels_synthesizer import vowels_synthesizer from utils.AFE.process_audio import process_audio @@ -19,7 +20,10 @@ def test_AFE(): # filename_out = None # filename_wav = "d:/M_Blok/GitHub/HSI_data/training/Interspeech_2021/15000events_50-400Hz_length500ms_gaps0ms.wav" - filename_wav = "d:/M_Blok/GitHub/HSI_data/training/testowe/15000events_50-400Hz_length500ms_gaps0ms.wav" + filename_wav = "test2_snr_40.wav" + + log_cfg = LogConfig() + log_cfg.init_logging("AFE_test") logging.info('START:') # start = timer() diff --git a/utils/AFE/process_audio.py b/utils/AFE/process_audio.py index 81dcb87..3b55ee7 100644 --- a/utils/AFE/process_audio.py +++ b/utils/AFE/process_audio.py @@ -95,7 +95,7 @@ def process_audio(filename_in = None, x = None, no_of_filters = 20, AFE_cfg = N "filter_bank_smoothing_mode": "delay", "CMPO_smoothing_mode": "none", "FB_to_CMPO_smoothing_factor": 1.0} # full FB smoothing/delay - raise Exception("please provide AFE_cfg param") + logging.info("WARNING: please provide AFE_cfg param") else: if "FB_to_CMPO_smoothing_factor" not in AFE_cfg: AFE_cfg["FB_to_CMPO_smoothing_factor"] = 1.0 -- GitLab