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
Paul Primus
dcase2020_task2
Commits
142a57be
Commit
142a57be
authored
Jun 15, 2020
by
Paul Primus
Browse files
add rerun script
parent
965e1ff3
Changes
1
Hide whitespace changes
Inline
Side-by-side
dcase2020_task2/data_sets/mcm_dataset.py
View file @
142a57be
...
...
@@ -179,7 +179,7 @@ class MachineDataSet(torch.utils.data.Dataset):
return
data
def
__load_data__
(
self
,
files
):
file_name
=
"{}_{}_{}_{}_{}_{}_{}_{}_{}_{}
_tmp
.npz"
.
format
(
file_name
=
"{}_{}_{}_{}_{}_{}_{}_{}_{}_{}.npz"
.
format
(
self
.
num_mel
,
self
.
n_fft
,
self
.
hop_size
,
...
...
@@ -204,12 +204,8 @@ class MachineDataSet(torch.utils.data.Dataset):
self
.
machine_id
))
for
i
,
f
in
enumerate
(
files
):
file
=
self
.
__load_preprocess_file__
(
f
)
if
file
.
shape
[
-
1
]
<
self
.
file_length
:
print
(
f
'Too short
{
f
}
'
)
elif
file
.
shape
[
-
1
]
>
self
.
file_length
:
print
(
f
'Too long
{
f
}
'
)
data
.
append
(
file
)
#
np.savez(file_path, *data)
np
.
savez
(
file_path
,
*
data
)
return
data
def
__load_preprocess_file__
(
self
,
file
):
...
...
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