From c7f20d1247b55427e321ab54c026b4995ce35c51 Mon Sep 17 00:00:00 2001 From: takenori-y Date: Mon, 17 Jun 2024 14:16:25 +0900 Subject: [PATCH 1/5] apply markdown formatter --- README.md | 30 ++++++++++++++++-------------- pyproject.toml | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7a1ca0f..3e4d02a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -diffsptk -======== +# diffsptk + *diffsptk* is a differentiable version of [SPTK](https://github.com/sp-nitech/SPTK) based on the PyTorch framework. [![Latest Manual](https://img.shields.io/badge/docs-latest-blue.svg)](https://sp-nitech.github.io/diffsptk/latest/) @@ -13,34 +13,34 @@ diffsptk [![GitHub Actions](https://github.com/sp-nitech/diffsptk/workflows/package/badge.svg)](https://github.com/sp-nitech/diffsptk/actions) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +## Requirements -Requirements ------------- - Python 3.8+ - PyTorch 1.11.0+ +## Documentation -Documentation -------------- - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for a reference manual. - Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive. +## Installation -Installation ------------- The latest stable release can be installed through PyPI by running + ```sh pip install diffsptk ``` + The development release can be installed from the master branch: + ```sh pip install git+https://github.com/sp-nitech/diffsptk.git@master ``` +## Examples -Examples --------- ### Mel-cepstral analysis and synthesis + ```python import diffsptk @@ -91,6 +91,7 @@ diffsptk.write("unvoiced.wav", x_unvoiced, sr) ``` ### Mel-spectrogram, MFCC, and PLP extraction + ```python import diffsptk @@ -138,6 +139,7 @@ print(Y.shape) ``` ### Subband decomposition + ```python import diffsptk @@ -166,6 +168,7 @@ print(error) ``` ### Constant-Q transform + ```python import diffsptk import librosa # This is to get sample audio. @@ -194,6 +197,7 @@ print(error) ``` ### Vector quantization + ```python import diffsptk @@ -212,14 +216,12 @@ error = (x_hat - x).abs().sum() print(error) ``` +## License -License -------- This software is released under the Apache License 2.0. +## Citation -Citation --------- ```bibtex @InProceedings{sp-nitech2023sptk, author = {Takenori Yoshimura and Takato Fujimoto and Keiichiro Oura and Keiichi Tokuda}, diff --git a/pyproject.toml b/pyproject.toml index fd54ef0..3d76a51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dynamic = ["version"] dev = [ "build", "isort", + "mdformat", "numpydoc", "pydata-sphinx-theme", "pytest", From 2f2218a97fdf983e04571008e8886fe02de8a998 Mon Sep 17 00:00:00 2001 From: takenori-y Date: Mon, 17 Jun 2024 14:16:37 +0900 Subject: [PATCH 2/5] format conf.py --- Makefile | 6 ++++-- docs/conf.py | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 93551d1..d9be26a 100644 --- a/Makefile +++ b/Makefile @@ -47,15 +47,17 @@ doc-clean: check: tool . ./venv/bin/activate && python -m ruff check $(PROJECT) tests - . ./venv/bin/activate && python -m ruff format --check $(PROJECT) tests + . ./venv/bin/activate && python -m ruff format --check $(PROJECT) tests docs . ./venv/bin/activate && python -m isort --check $(PROJECT) tests + . ./venv/bin/activate && python -m mdformat --check README.md ./tools/taplo/taplo fmt --check pyproject.toml ./tools/yamlfmt/yamlfmt --lint *.yml .github/workflows/*.yml format: tool . ./venv/bin/activate && python -m ruff check --fix $(PROJECT) tests - . ./venv/bin/activate && python -m ruff format $(PROJECT) tests + . ./venv/bin/activate && python -m ruff format $(PROJECT) tests docs . ./venv/bin/activate && python -m isort $(PROJECT) tests + . ./venv/bin/activate && python -m mdformat README.md ./tools/taplo/taplo fmt pyproject.toml ./tools/yamlfmt/yamlfmt *.yml .github/workflows/*.yml diff --git a/docs/conf.py b/docs/conf.py index 4c97a50..2bae79f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,14 +12,15 @@ # import os import sys -sys.path.insert(0, os.path.abspath('..')) + +sys.path.insert(0, os.path.abspath("..")) # -- Project information ----------------------------------------------------- -project = 'diffsptk' -copyright = '2022, SPTK Working Group' -author = 'SPTK Working Group' +project = "diffsptk" +copyright = "2022, SPTK Working Group" +author = "SPTK Working Group" exec(open(f"../{project}/version.py").read()) version = __version__ release = __version__ @@ -31,9 +32,9 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.viewcode', - 'numpydoc', + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "numpydoc", ] # Add any paths that contain templates here, relative to this directory. @@ -42,7 +43,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = [ + "_build", + "Thumbs.db", + ".DS_Store", +] # -- Options for HTML output ------------------------------------------------- @@ -50,7 +55,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'pydata_sphinx_theme' +html_theme = "pydata_sphinx_theme" # Disable navigation with keys. html_theme_options = {"navigation_with_keys": False} From 59ffc04d52dfa696bcc9a57c983ac090f1a9c595 Mon Sep 17 00:00:00 2001 From: takenori-y Date: Mon, 17 Jun 2024 14:22:16 +0900 Subject: [PATCH 3/5] format cff --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d9be26a..10f8458 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ check: tool . ./venv/bin/activate && python -m isort --check $(PROJECT) tests . ./venv/bin/activate && python -m mdformat --check README.md ./tools/taplo/taplo fmt --check pyproject.toml - ./tools/yamlfmt/yamlfmt --lint *.yml .github/workflows/*.yml + ./tools/yamlfmt/yamlfmt --lint *.cff *.yml .github/workflows/*.yml format: tool . ./venv/bin/activate && python -m ruff check --fix $(PROJECT) tests @@ -59,7 +59,7 @@ format: tool . ./venv/bin/activate && python -m isort $(PROJECT) tests . ./venv/bin/activate && python -m mdformat README.md ./tools/taplo/taplo fmt pyproject.toml - ./tools/yamlfmt/yamlfmt *.yml .github/workflows/*.yml + ./tools/yamlfmt/yamlfmt *.cff *.yml .github/workflows/*.yml test: tool [ -n "$(MODULE)" ] && module=tests/test_$(MODULE).py || module=; \ From 9dc09a5a1afc66dfa6d17f49468ae68d11f718e3 Mon Sep 17 00:00:00 2001 From: takenori-y Date: Mon, 17 Jun 2024 15:56:59 +0900 Subject: [PATCH 4/5] workaround --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d76a51..559e0e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", ] dependencies = [ + "numpy < 2.0.0", "librosa >= 0.10.1", "soundfile >= 0.10.2", "torch >= 1.11.0", @@ -31,7 +32,6 @@ dependencies = [ "torchcrepe >= 0.0.21", "torchlpc >= 0.2.0", "vector-quantize-pytorch >= 0.8.0, <= 1.12.12", - "numpy", ] dynamic = ["version"] From dee78ed46b84c285ce51e924eb70f9a4f09dce96 Mon Sep 17 00:00:00 2001 From: takenori-y Date: Mon, 17 Jun 2024 15:57:17 +0900 Subject: [PATCH 5/5] check pytorch 2.3.1 --- .github/workflows/ci.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a93ddb..43e3e78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: torch: 1.11.0 torchaudio: 0.11.0 - python: 3.12 - torch: 2.3.0 - torchaudio: 2.3.0 + torch: 2.3.1 + torchaudio: 2.3.1 steps: - name: Clone diff --git a/README.md b/README.md index 3e4d02a..67b253f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.0.1/) [![Downloads](https://static.pepy.tech/badge/diffsptk)](https://pepy.tech/project/diffsptk) [![Python Version](https://img.shields.io/pypi/pyversions/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk) -[![PyTorch Version](https://img.shields.io/badge/pytorch-1.11.0%20%7C%202.3.0-orange.svg)](https://pypi.python.org/pypi/diffsptk) +[![PyTorch Version](https://img.shields.io/badge/pytorch-1.11.0%20%7C%202.3.1-orange.svg)](https://pypi.python.org/pypi/diffsptk) [![PyPI Version](https://img.shields.io/pypi/v/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk) [![Codecov](https://codecov.io/gh/sp-nitech/diffsptk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sp-nitech/diffsptk) [![License](https://img.shields.io/github/license/sp-nitech/diffsptk.svg)](https://github.com/sp-nitech/diffsptk/blob/master/LICENSE)