未验证 提交 c08c3e7b 编写于 作者: 小湉湉's avatar 小湉湉 提交者: GitHub

Merge pull request #1204 from KPatr1ck/esc50

[Doc]Update docs/source/cls/custom_dataset.md.
...@@ -24,10 +24,10 @@ class CustomDataset(AudioClassificationDataset): ...@@ -24,10 +24,10 @@ class CustomDataset(AudioClassificationDataset):
'dog', 'dog',
] ]
def __init__(self): def __init__(self, **kwargs):
files, labels = self._get_data() files, labels = self._get_data()
super(CustomDataset, self).__init__( super(CustomDataset, self).__init__(
files=files, labels=labels, feat_type='raw') files=files, labels=labels, feat_type='raw', **kwargs)
def _get_data(self): def _get_data(self):
''' '''
...@@ -53,8 +53,9 @@ from paddleaudio.features import LogMelSpectrogram ...@@ -53,8 +53,9 @@ from paddleaudio.features import LogMelSpectrogram
from custom_dataset import CustomDataset from custom_dataset import CustomDataset
# Feature config should be align with pretrained model # Feature config should be align with pretrained model
sample_rate = 32000
feat_conf = { feat_conf = {
'sr': 32000, 'sr': sample_rate,
'n_fft': 1024, 'n_fft': 1024,
'hop_length': 320, 'hop_length': 320,
'window': 'hann', 'window': 'hann',
...@@ -64,7 +65,7 @@ feat_conf = { ...@@ -64,7 +65,7 @@ feat_conf = {
'n_mels': 64, 'n_mels': 64,
} }
train_ds = CustomDataset() train_ds = CustomDataset(sample_rate=sample_rate)
feature_extractor = LogMelSpectrogram(**feat_conf) feature_extractor = LogMelSpectrogram(**feat_conf)
train_sampler = paddle.io.DistributedBatchSampler( train_sampler = paddle.io.DistributedBatchSampler(
......
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
# limitations under the License. # limitations under the License.
import setuptools import setuptools
import paddleaudio
# set the version here # set the version here
version = '0.1.0a' version = paddleaudio.__version__
setuptools.setup( setuptools.setup(
name="paddleaudio", name="paddleaudio",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册