-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] add EnCodec model embeddings to FAD calculation #23
Conversation
@@ -32,7 +34,8 @@ def load_audio_task(fname, sample_rate, dtype="float32"): | |||
wav_data = wav_data / float(2**31) | |||
|
|||
# Convert to mono | |||
if len(wav_data.shape) > 1: | |||
assert channels in [1, 2], "channels must be 1 or 2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
channels
here is unspecified, I guess you miss a line before this to calculatechannels
from wav_data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's fixed now. It's an input to the function, defaulting to 1 unless specified (as should be done for encodec 48khz)
@@ -309,8 +360,8 @@ def update(*a): | |||
for fname in os.listdir(dir): | |||
res = pool.apply_async( | |||
load_audio_task, | |||
args=(os.path.join(dir, fname), self.sample_rate, dtype), | |||
callback=update | |||
args=(os.path.join(dir, fname), self.sample_rate, self.channels, dtype), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect self.channels
is not defined here, but please correct me if I am wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it looks like I erased the definition when commiting
@ivanlmh Huge thanks to you contribution! Encodec is a very useful one. |
I think that's fixed... idk why the definitions disappeared, but anyway :) |
@ivanlmh Merged, huge thanks for your contribution once again! |
Hi Hao Hao, I've added Meta's EnCodec model (the 2 main versions they offer pre-trained) for FAD calculation
Let me know if there is something you think should be fixed or whatever :)