Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cdx-submissions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yoyololicon
cdx-submissions
Commits
7b2b2996
Commit
7b2b2996
authored
2 years ago
by
Chin-Yun Yu
Browse files
Options
Downloads
Patches
Plain Diff
comment out speech rnn
parent
daf648f1
Branches
combine-speech
Branches containing commit
Tags
submission-hdemucs+rnn-music-99k
submission-hdemucs+rnn-music-99k-r2
submission-hdemucs+rnn-music-99k-rerun
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
my_submission/ensemble.py
+12
-13
12 additions, 13 deletions
my_submission/ensemble.py
with
12 additions
and
13 deletions
my_submission/ensemble.py
+
12
−
13
View file @
7b2b2996
...
...
@@ -57,10 +57,10 @@ class EnsembleNet(IdentitySeparationModel):
)
self
.
rnn_music
=
model
.
to
(
self
.
device
)
model
,
config
=
load_checkpoint
(
self
.
speech_bandsplitRNN_path
,
self
.
bandsplitRNN_ckpt_name
)
self
.
rnn_speech
=
model
.
to
(
self
.
device
)
#
model, config = load_checkpoint(
#
self.speech_bandsplitRNN_path, self.bandsplitRNN_ckpt_name
#
)
#
self.rnn_speech = model.to(self.device)
n_fft
=
config
[
"
model
"
][
"
init_args
"
][
"
n_fft
"
]
hop_length
=
config
[
"
model
"
][
"
init_args
"
][
"
hop_length
"
]
...
...
@@ -139,8 +139,9 @@ class EnsembleNet(IdentitySeparationModel):
# bandsplitRNN
X
=
self
.
spec
(
mixed_sound_array
[:
2
].
transpose
(
0
,
1
))
music_mask
=
self
.
rnn_music
(
X
.
abs
())
speech_mask
=
self
.
rnn_speech
(
X
.
abs
())
mask
=
torch
.
stack
([
music_mask
,
speech_mask
],
dim
=
1
)
# speech_mask = self.rnn_speech(X.abs())
# mask = torch.stack([music_mask, speech_mask], dim=1)
mask
=
music_mask
.
unsqueeze
(
1
)
# speech_spec = X * mask
speech_spec
=
self
.
mwf
(
mask
,
X
)
separated
=
self
.
inv_spec
(
speech_spec
).
squeeze
().
cpu
()
...
...
@@ -150,19 +151,17 @@ class EnsembleNet(IdentitySeparationModel):
separated
,
(
0
,
mixed_sound_array
.
shape
[
-
1
]
-
separated
.
shape
[
-
1
])
)
separated_music
,
separated_speech
,
separated_fx
=
separated
.
permute
(
0
,
2
,
1
).
numpy
()
separated_music
,
separated_fx
=
separated
.
permute
(
0
,
2
,
1
).
numpy
()
# input_length = len(left_mixed_arr)
separated_music_arrays
[
"
music
"
]
+=
separated_music
separated_music_arrays
[
"
music
"
]
/=
2
separated_music_arrays
[
"
effect
"
]
+=
separated_fx
separated_music_arrays
[
"
effect
"
]
/=
2
#
separated_music_arrays["effect"] += separated_fx
#
separated_music_arrays["effect"] /= 2
separated_music_arrays
[
"
dialog
"
]
+=
separated_speech
.
mean
(
axis
=
1
,
keepdims
=
True
)
separated_music_arrays
[
"
dialog
"
]
/=
2
#
separated_music_arrays["dialog"] += separated_speech.mean(axis=1, keepdims=True)
#
separated_music_arrays["dialog"] /= 2
return
separated_music_arrays
,
output_sample_rates
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment