Giter Site home page Giter Site logo

Comments (5)

jmcasebeer avatar jmcasebeer commented on May 24, 2024

Hello, and thanks for the interest. Could you please share the exact code you ran, and describe what setup you did before that?

from metaaf.

aleksandra-bebe avatar aleksandra-bebe commented on May 24, 2024

@jmcasebeer I downloaded pre-trained models from the link and provided the path to the AEC model. Additionally, I downloaded the AEC challenge dataset and specified its path in the config.py script." and on this line of code pred = system.infer({"signals": d_input, "metadata": {}}, fit_infer=fit_infer)[0] give me issue
This is the code that I ran.
import os
from aec_eval import get_system_ckpt
import numpy as np
import librosa
import soundfile as sf
import aec

ckpt_dir = r"C:\Users\pc\Desktop\AI-Beamformers\meta-af\MetaAF\v0.1.0_models\aec"
name = "aec_16_dt_c"
date = "2022_04_10_15_57_12"
epoch = 230

ckpt_loc = os.path.join(ckpt_dir, name, date)

system, kwargs, outer_learnable = get_system_ckpt(
ckpt_loc,
epoch,
model_type="egru",
system_len=None,
)
fit_infer = system.make_fit_infer(outer_learnable=outer_learnable)
fs = 16000

out_dir = "metaAF_res"
os.makedirs(out_dir, exist_ok=True)

u, _ = librosa.load(r"C:\Users\pc\Desktop\AI-Beamformers\meta-af\MetaAF\zoo\aec\u.wav", sr=fs)
d, _ = librosa.load(r"C:\Users\pc\Desktop\AI-Beamformers\meta-af\MetaAF\zoo\aec\d.wav", sr=fs)
s, _ = librosa.load(r"C:\Users\pc\Desktop\AI-Beamformers\meta-af\MetaAF\zoo\aec\s.wav", sr=fs)
e = d - s
d_mp3_input = {"u": u[None, :, None], "d": d[None, :, None],
"s": s[None, :, None], "e": e[None, :, None]}

pred_mp3 = system.infer({"signals": d_mp3_input, "metadata": {}}, fit_infer=fit_infer)[
0
]
pred_mp3 = np.array(pred_mp3[0, :, 0])

dset = aec.MSFTAECDataset_RIR(mode='test', double_talk=True, random_roll=True, scene_change=False)
data = dset[0]
u, d, e, s = (
data["signals"]["u"],
data["signals"]["d"],
data["signals"]["e"],
data["signals"]["s"],
)
d_input = {"u": u[None], "d": d[None], "s": s[None], "e": e[None]}

pred = system.infer({"signals": d_input, "metadata": {}}, fit_infer=fit_infer)[
0
]
pred = np.array(pred[0, :, 0])

sf.write(os.path.join(out_dir, f"_out.wav"), pred, fs)

from metaaf.

aleksandra-bebe avatar aleksandra-bebe commented on May 24, 2024

@jmcasebeer
Hello! I hope you had a wonderful holidays. Do you have any solution regarding my issue?

from metaaf.

jmcasebeer avatar jmcasebeer commented on May 24, 2024

Could you please try using the most recent model weights? It looks like you're using the 0.1.0 weights with the 1.0.1 code. You can get the 1.0.1 weights here. Then, update the checkpoint loading to use a more recent checkpoint.

For example:

ckpt_dir = "v1.0.1_models/aec/"
name = "meta_aec_16_combo_rl_4_1024_512_r2"
date = "2022_10_19_23_43_22"
epoch = 110

ckpt_loc = os.path.join(ckpt_dir, name, date)

system, kwargs, outer_learnable = get_system_ckpt(
    ckpt_loc,
    epoch,
)
fit_infer = system.make_fit_infer(outer_learnable=outer_learnable)
fs = 16000

from metaaf.

aleksandra-bebe avatar aleksandra-bebe commented on May 24, 2024

@jmcasebeer Thank you very much, now it work !

from metaaf.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.