tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.9k stars 1.2k forks source link

'SVC' object has no attribute 'classify' #367

Closed troncook closed 2 years ago

troncook commented 2 years ago

from pyAudioAnalysis import audioSegmentation num_speakers = 4 audioSegmentation.speaker_diarization("ES2004.wav", num_speakers)

AttributeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_46952/3533011787.py in 1 from pyAudioAnalysis import audioSegmentation 2 num_speakers = 4 ----> 3 audioSegmentation.speaker_diarization("ES2004.wav", num_speakers)

~\anaconda3\lib\site-packages\pyAudioAnalysis\audioSegmentation.py in speaker_diarization(filename, n_speakers, mid_window, mid_step, short_window, lda_dim, plot_res) 913 feature_norm_all = (mt_feats_to_red[:, index] - mean_all) / std_all 914 feature_norm_fm = (mt_feats_to_red[:, index] - mean_fm) / stdfm --> 915 , p1 = at.classifier_wrapper(classifier_all, "knn", 916 feature_normall) 917 , p2 = at.classifier_wrapper(classifier_fm, "knn", feature_norm_fm)

~\anaconda3\lib\site-packages\pyAudioAnalysis\audioTrainTest.py in classifier_wrapper(classifier, classifier_type, test_sample) 83 probability = -1 84 if classifier_type == "knn": ---> 85 class_id, probability = classifier.classify(test_sample) 86 elif classifier_type == "svm" or \ 87 classifier_type == "randomforest" or \ 'SVC' object has no attribute 'classify'

tyiannak commented 2 years ago

Can you check on the latest version. It should be ok now in both pypi and source code version as I've changed the default method in speaker diarization and also replaced the knn models with the correct ones (svms)