resemble-ai / Resemblyzer

A python package to analyze and compare voices with deep learning
Apache License 2.0
2.66k stars 419 forks source link

Update demo_utils.py #53

Closed abhinavms closed 3 years ago

abhinavms commented 3 years ago

The original demo_util.py pointed to wrong location. sampling_rate is under resemblyzer.audio

CorentinJ commented 3 years ago

Hmm no, it's there: https://github.com/resemble-ai/Resemblyzer/blob/master/resemblyzer/__init__.py#L5 Has this not been working for you?

abhinavms commented 3 years ago

I tried running demo01 in Google Colab using the contents of the files demo_utils.py and demo01_similarity.py and it threw the error shown in the image attached below. Resemblyzer was installed throught pip. When i changed the import statement in demo_util.py from from resemblyzer import sampling_rate to from resemblyzer.audio import sampling_rate it worked.

image

abhinavms commented 3 years ago

The file /usr/local/lib/python3.7/dist-packages/resemblyzer/__init__.py has the following contents

name = "resemblyzer"

from resemblyzer.audio import preprocess_wav, wav_to_mel_spectrogram, trim_long_silences, \
    normalize_volume
from resemblyzer.voice_encoder import VoiceEncoder

I guess the pip might have installed an older version.

CorentinJ commented 3 years ago

Ah it's just that you shouldn't mix the python package with the repo, since the package isn't up to the latest commit. If you clone the repo, you don't need to install the package since it will be present in your working directory.