summaryrefslogtreecommitdiff
path: root/become_yukarin/dataset/utility.py
diff options
context:
space:
mode:
authorHiroshiba Kazuyuki <kazuyuki_hiroshiba@dwango.co.jp>2018-01-25 20:10:01 +0900
committerHiroshiba Kazuyuki <kazuyuki_hiroshiba@dwango.co.jp>2018-01-25 20:10:01 +0900
commitc44e1ec9b24a70cc30de5682bf1855afe5eb0485 (patch)
treedea956f863f5d04a5206a43dbc8fc62eb6c90275 /become_yukarin/dataset/utility.py
parent3ecf878ec5f35c8242b0b5e488d8f8d1f50e9aaf (diff)
mypy & harvest追加
Diffstat (limited to 'become_yukarin/dataset/utility.py')
-rw-r--r--become_yukarin/dataset/utility.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/become_yukarin/dataset/utility.py b/become_yukarin/dataset/utility.py
index 9797818..ca68acf 100644
--- a/become_yukarin/dataset/utility.py
+++ b/become_yukarin/dataset/utility.py
@@ -9,7 +9,7 @@ class DTWAligner(object):
from https://github.com/r9y9/nnmnkwii/blob/4cade86b5c35b4e35615a2a8162ddc638018af0e/nnmnkwii/preprocessing/alignment.py#L14
"""
- def __init__(self, x, y, dist=lambda x, y: numpy.linalg.norm(x - y), radius=1):
+ def __init__(self, x, y, dist=lambda x, y: numpy.linalg.norm(x - y), radius=1) -> None:
assert x.ndim == 2 and y.ndim == 2
_, path = fastdtw.fastdtw(x, y, radius=radius, dist=dist)
@@ -40,10 +40,11 @@ class DTWAligner(object):
class MFCCAligner(DTWAligner):
- def __init__(self, x, y, *args, **kwargs):
+ def __init__(self, x, y, *args, **kwargs) -> None:
x = self._calc_aligner_feature(x)
y = self._calc_aligner_feature(y)
- super().__init__(x, y, *args, dist=nnmnkwii.metrics.melcd, **kwargs)
+ kwargs.update(dist=nnmnkwii.metrics.melcd)
+ super().__init__(x, y, *args, **kwargs)
@classmethod
def _calc_delta(cls, x):