Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
184466a9
Unverified
Commit
184466a9
authored
Nov 01, 2021
by
nateanl
Committed by
GitHub
Nov 01, 2021
Browse files
Add melkwargs setting for MFCC in HuBERT pipeline (#1949)
parent
0c48eddf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
examples/hubert/utils/feature_utils.py
examples/hubert/utils/feature_utils.py
+3
-1
No files found.
examples/hubert/utils/feature_utils.py
View file @
184466a9
...
@@ -68,7 +68,9 @@ def extract_feature(
...
@@ -68,7 +68,9 @@ def extract_feature(
waveform
=
waveform
[
0
].
to
(
device
)
waveform
=
waveform
[
0
].
to
(
device
)
if
feature_type
==
"mfcc"
:
if
feature_type
==
"mfcc"
:
feature_extractor
=
torchaudio
.
transforms
.
MFCC
(
feature_extractor
=
torchaudio
.
transforms
.
MFCC
(
sample_rate
=
sample_rate
sample_rate
=
sample_rate
,
n_mfcc
=
13
,
melkwargs
=
{
'n_fft'
:
400
,
'hop_length'
:
160
,
'center'
:
False
}
).
to
(
device
)
).
to
(
device
)
mfccs
=
feature_extractor
(
waveform
)
# (freq, time)
mfccs
=
feature_extractor
(
waveform
)
# (freq, time)
# mfccs = torchaudio.compliance.kaldi.mfcc(
# mfccs = torchaudio.compliance.kaldi.mfcc(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment