Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony Larcher
sidekit
Commits
49ac37f2
Commit
49ac37f2
authored
Apr 13, 2021
by
Anthony Larcher
Browse files
debg
parent
8ccb5265
Changes
2
Hide whitespace changes
Inline
Side-by-side
nnet/xsets.py
View file @
49ac37f2
...
@@ -412,7 +412,7 @@ class IdMapSet(Dataset):
...
@@ -412,7 +412,7 @@ class IdMapSet(Dataset):
else
:
else
:
duration
=
int
(
self
.
idmap
.
stop
[
index
]
*
0.01
)
*
self
.
sample_rate
-
start
duration
=
int
(
self
.
idmap
.
stop
[
index
]
*
0.01
)
*
self
.
sample_rate
-
start
# add this in case the segment is too short
# add this in case the segment is too short
if
duration
<=
self
.
self
.
min_duration
*
self
.
sample_rate
:
if
duration
<=
self
.
min_duration
*
self
.
sample_rate
:
middle
=
start
+
duration
//
2
middle
=
start
+
duration
//
2
start
=
max
(
0
,
int
(
middle
-
(
self
.
min_sample_nb
/
2
)))
start
=
max
(
0
,
int
(
middle
-
(
self
.
min_sample_nb
/
2
)))
duration
=
int
(
self
.
min_sample_nb
)
duration
=
int
(
self
.
min_sample_nb
)
...
...
nnet/xvector.py
View file @
49ac37f2
...
@@ -1585,8 +1585,8 @@ def extract_embeddings(idmap_name,
...
@@ -1585,8 +1585,8 @@ def extract_embeddings(idmap_name,
if
isinstance
(
model_filename
,
str
):
if
isinstance
(
model_filename
,
str
):
checkpoint
=
torch
.
load
(
model_filename
,
map_location
=
device
)
checkpoint
=
torch
.
load
(
model_filename
,
map_location
=
device
)
speaker_number
=
checkpoint
[
"speaker_number"
]
speaker_number
=
checkpoint
[
"speaker_number"
]
model_
archi
=
checkpoint
[
"model_archi"
]
model_
opts
=
checkpoint
[
"model_archi"
]
model
=
Xtractor
(
speaker_number
,
model_archi
=
model_
archi
,
loss
=
checkpoint
[
"loss
"
])
model
=
Xtractor
(
speaker_number
,
model_archi
=
model_
opts
[
"model_type"
],
loss
=
model_opts
[
"loss"
][
"type
"
])
model
.
load_state_dict
(
checkpoint
[
"model_state_dict"
])
model
.
load_state_dict
(
checkpoint
[
"model_state_dict"
])
else
:
else
:
model
=
model_filename
model
=
model_filename
...
...
Write
Preview
Supports
Markdown
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