sucv / ABAW3

We achieved the 2nd and 3rd places in ABAW3 and ABAW5, respectively.
23 stars 5 forks source link

mfcc feature extraction error #14

Open sbelharbi opened 4 months ago

sbelharbi commented 4 months ago

hi, have you encountered this error when extracting mfcc features at abaw5_preprocessing/base/audio.py, in extract_mfcc when creating this:

smile = opensmile.Smile(
        feature_set=opensmile_config_path,
        feature_level=opensmile.FeatureLevel.LowLevelDescriptors
        logfile="smile.log"
    )

opensmile_config_path points to the correct absolute path of abaw5_preprocessing/load/opensmile_mfcc.conf.

  0%|                                                                                        | 0/69 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "abaw5_preprocessing/project/abaw5/main.py", line 55, in <module>
    pre.prepare_data()
  File "abaw5_preprocessing/base/preprocessing.py", line 278, in prepare_data
    self.extract_mfcc_fn(idx, output_filename, npy_folder)
  File "abaw5_preprocessing/base/preprocessing.py", line 824, in extract_mfcc_fn
    extract_mfcc(input_path=input_path,
  File "abaw5_preprocessing/base/audio.py", line 90, in extract_mfcc
    smile = opensmile.Smile(
  File "lib/python3.10/site-packages/audobject/core/decorator.py", line 115, in wrapper
    func(self, *args, **kwargs)
  File "lib/python3.10/site-packages/audeer/core/utils.py", line 192, in new_func
    return func(*args, **kwargs)
  File "lib/python3.10/site-packages/opensmile/core/smile.py", line 185, in __init__
    self.params = self.to_dict(flatten=True)
  File "lib/python3.10/site-packages/audobject/core/object.py", line 300, in to_dict
    name = utils.create_class_key(self.__class__, include_version)
  File "lib/python3.10/site-packages/audobject/core/utils.py", line 38, in create_class_key
    PACKAGES_DISTRIBUTIONS = packages_distributions()
  File "lib/python3.10/site-packages/importlib_metadata/__init__.py", line 1034, in packages_distributions
    for dist in distributions():
  File "/ib/python3.10/site-packages/importlib_metadata/__init__.py", line 880, in <genexpr>
    return itertools.chain.from_iterable(
TypeError: unhashable type: 'list'

the error points to an issue in the creation of opensmile.Smile. any idea how to fix this? thanks

sucv commented 3 months ago

Hi,

In my experience & my pipeline, MFCC is a "weaker" feature compared than VGGish and other deep features. Consider discarding it.

Otherwise, you may replace the code snippet with the call of OpenSmile executable following here.