Closed DeboBurro closed 1 year ago
Hello and thanks for the question. Can you check that the dataset was able to find the rirs? Please run the code below and let me know the result. I've pasted the output when I run it on my machine.
import zoo.aec.aec as aec
dset = aec.MSFTAECDataset_RIR(mode="test", double_talk=False, scene_change=False)
print(f"Num. RIRs Found:{len(dset.rirs)} -- First RIR {dset.rirs[0]} -- Last RIR {dset.rirs[-1]}")
# The output
# Num. RIRs Found:500 -- First RIR /mnt/data/AEC/RIRS_NOISES/simulated_rirs/mediumroom/Room040/Room040-00054.wav -- Last RIR /mnt/data/AEC/RIRS_NOISES/simulated_rirs/largeroom/Room118/Room118-00017.wav
hi @jmcasebeer thanks for responding.
Python 3.7.16 (default, Jan 17 2023, 22:20:44)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zoo.aec.aec as aec
>>> dset = aec.MSFTAECDataset_RIR(mode="test", double_talk=False, scene_change=False)
>>> print(f"Num. RIRs Found:{len(dset.rirs)} -- First RIR {dset.rirs[0]} -- Last RIR {dset.rirs[-1]}")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> dset.rirs
[]
>>> dset.__dict__
{'farend_speech_dir': '/home/username/personal/dataset/AEC-Challenge/datasets/synthetic/farend_speech', 'nearend_speech_dir': '/home/username/personal/dataset/AEC-Challenge/datasets/synthetic/nearend_speech', 'double_talk': False, 'scene_change': False, 'random_roll': False, 'max_len': 160000, 'rir_len': None, 'rirs': [], 'mode': 'test', 'offset': 0}
Looks like the dataset isn't finding the RIRs. Can you check that they're unzipped and inside /home/username/personal/rirs_noises/RIRS_NOISES/
?
The dataset grabs all the file names via:
import os
import glob2
RIR_DATA_DIR = "/home/username/personal/rirs_noises/RIRS_NOISES/"
rir_dir = os.path.join(RIR_DATA_DIR, "simulated_rirs/")
rirs = glob2.glob(rir_dir + "/**/*.wav")
Python 3.7.16 (default, Jan 17 2023, 22:20:44)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import glob2
>>> RIR_DATA_DIR = "/home/username/personal/dataset/rirs_noises/RIRS_NOISES/"
>>> rir_dir = os.path.join(RIR_DATA_DIR, "simulated_rirs/")
>>> rirs = glob2.glob(rir_dir + "/**/*.wav")
>>> rirs
['/home/username/personal/dataset/rirs_noises/RIRS_NOISES/simulated_rirs/largeroom/Room030/Room030-00032.wav', '/home/username/personal/dataset/rirs_noises/RIRS_NOISES/simulated_rirs/largeroom/Room030/Room030-00088.wav',
.
.
]
Could you check that the path was correctly set in the config file? Looks like your data is setup right. You could also try manually passing in the RIR_DATA_DIR directly to the dataset.
from zoo.__config__ import RIR_DATA_DIR
print(RIR_DATA_DIR)
import zoo.aec.aec as aec
dset = aec.MSFTAECDataset_RIR(rir_dir="/home/username/personal/dataset/rirs_noises/RIRS_NOISES/", mode="test", double_talk=False, scene_change=False)
print(f"Num. RIRs Found:{len(dset.rirs)} -- First RIR {dset.rirs[0]} -- Last RIR {dset.rirs[-1]}")
Python 3.7.16 (default, Jan 17 2023, 22:20:44)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zoo.aec.aec as aec
>>> from zoo.__config__ import RIR_DATA_DIR
>>> print(RIR_DATA_DIR)
/home/username/personal/dataset/rirs_noises/RIRS_NOISES/
>>> dset = aec.MSFTAECDataset_RIR(rir_dir="/home/username/personal/dataset/rirs_noises/RIRS_NOISES/", mode="test", double_talk=False, scene_change=False)
>>> print(f"Num. RIRs Found:{len(dset.rirs)} -- First RIR {dset.rirs[0]} -- Last RIR {dset.rirs[-1]}")
Num. RIRs Found:500 -- First RIR /home/username/personal/dataset/rirs_noises/RIRS_NOISES/simulated_rirs/largeroom/Room198/Room198-00030.wav -- Last RIR /home/username/personal/dataset/rirs_noises/RIRS_NOISES/simulated_rirs/smallroom/Room116/Room116-00081.wav
not sure why it's not populated properly when running the aec_eval.py
but I right now manually put the rir_dir
as the keyword when it instantiate the dataset object. And it works. thanks
aec.MSFTAECDataset_RIR(
rir_dir="/home/username/personal/dataset/rirs_noises/RIRS_NOISES/",
mode="test",
double_talk=False,
scene_change=False,
random_roll=kwargs["random_roll"],
rir_len=eval_kwargs["true_rir_len"],
)
Glad it works. You may also want to try the 1.0.1 models -- they should be better.
git tag :
v1.0.0
model : 1.0.0 checkpoint dataset: AEC-challenge and RIRS US mirror content of thezoo/__config__.py
file:Cannot run
aec_eval.py
using pretrained model on the datasets