From d19e0eb84a57c7a136334f0db8b404bb071ea325 Mon Sep 17 00:00:00 2001 From: marcsello Date: Wed, 30 Sep 2020 06:19:53 +0200 Subject: [PATCH] Fixed some type errors --- src/preprocessor/soundpreprocessor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/preprocessor/soundpreprocessor.py b/src/preprocessor/soundpreprocessor.py index 5cb0b7d..397fe07 100644 --- a/src/preprocessor/soundpreprocessor.py +++ b/src/preprocessor/soundpreprocessor.py @@ -69,7 +69,6 @@ class SoundPreProcessor(AbcPreProcessor): self._mid_window, self._mid_step, self._short_window, \ self._short_step, self._compute_beat = load_model(self._temp_model_name) - logging.info("The loaded model contains the following classes: " + ", ".join(self._classes)) if config.SVM_TARGET_CLASS_NAME not in self._classes: raise Exception(f"The specified target class {config.SVM_TARGET_CLASS_NAME} is not in the possible classes") @@ -111,9 +110,11 @@ class SoundPreProcessor(AbcPreProcessor): target_id = self._classes.index(config.SVM_TARGET_CLASS_NAME) # Might raise ValueError feature_vector = (mid_features - self._mean) / self._std - class_id, probability = classifier_wrapper(self._classifier, self._model_details['type'], feature_vector) + class_id, probability = classifier_wrapper(self._classifier, self._model_details['type'].lower(), + feature_vector) + class_id = int(class_id) # faszom - logging.debug(f"Sample {file_path} identified as {self._classes[class_id]} with the probablility of {probability}") + logging.debug(f"Sample {file_path} identified as {self._classes[class_id]} with the probablility of {probability[class_id]}") return bool(class_id == target_id)