From a71be6c3a0b143e7dda6b0c53ec94c50135b9052 Mon Sep 17 00:00:00 2001 From: revsic Date: Wed, 9 Feb 2022 00:04:20 +0900 Subject: [PATCH] dump: Fix preproc --- sample.py | 9 ++++++--- utils/dump.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sample.py b/sample.py index a3456e3..a5de567 100644 --- a/sample.py +++ b/sample.py @@ -50,10 +50,13 @@ speechset.utils.mp_dump(acoustic, DUMP_PATH, 4) # load dump -dumped = speechset.utils.DumpDataset( - speechset.AcousticDataset, DUMP_PATH) +class WrappedAcoustic(speechset.utils.IDWrapper): + def __init__(self, *args, **kwargs): + super().__init__(speechset.AcousticDataset(*args, **kwargs)) + +dumped = speechset.utils.DumpDataset(WrappedAcoustic, DUMP_PATH) # unpack -sid, text, mel, textlen, mellen = acoustic[0:3] +sid, text, mel, textlen, mellen = dumped[0:3] print(sid.shape, text.shape, mel.shape, textlen.shape, mellen.shape) diff --git a/utils/dump.py b/utils/dump.py index ba1fa97..0dca4e2 100644 --- a/utils/dump.py +++ b/utils/dump.py @@ -43,7 +43,7 @@ def preprocessor(path: str) -> Any: Returns: loaded. """ - return np.load(path, allow_pickle=True).item() + return np.load(path, allow_pickle=True) return preprocessor