Skip to content

Commit

Permalink
rebuild repository
Browse files Browse the repository at this point in the history
  • Loading branch information
k2kobayashi committed Jun 1, 2020
1 parent 6b4fff3 commit 1e59783
Show file tree
Hide file tree
Showing 56 changed files with 5,775 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
paths-ignore:
- '**.md'
branches:
- '*'
schedule:
- cron: 0 0 * * 1

jobs:
check_skip:
runs-on: ubuntu-18.04
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"
linter_and_test:
runs-on: ubuntu-18.04
needs: check_skip
strategy:
max-parallel: 10
matrix:
python-version: [3.6]
pytorch-version: [1.4]
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip-
- name: Install dependencies
run: |
# install python modules
python -m pip install --upgrade pip
pip install -q -U numpy
pip install -q torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/cpu/stable.html
pip install -q -e .
pip install -q -r tools/test_requirements.txt
# install shell check
wget https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz
tar -xvf shellcheck-stable.linux.x86_64.tar.xz
- name: ShellCheck
run: |
export PATH=shellcheck-stable:$PATH
find egs -name "*.sh" | while read line; do shellcheck -x --shell=bash -P $(dirname $line) ${line}; done
# - name: Flake8
# run: |
# flake8 crak
- name: Pytest
run: |
pytest test
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
*.swp
*.pyc
slurm-*.out
.DS_Store
*.h5
*.pkl
wav
.nfs*
*.out
.autoenv.zsh

##################
# For Tools
##################
/tools/commands/analysis/analysis
/tools/commands/get_f0s/get_f0s

/tools/commands/get_f0s/Makefile
/tools/commands/get_f0s/config.status
/tools/commands/get_f0s/config.log
/tools/commands/get_f0s/.deps/get_f0s.Po
/tools/commands/get_f0s/.deps/misc.Po
/tools/commands/get_f0s/.deps/sigproc.Po
/tools/commands/get_f0s/Makefile
/tools/commands/get_f0s/config.status
/tools/commands/get_f0s/configure
/tools/commands/get_f0s/autom4te.cache/

/tools/sprocket
/tools/venv
*.o
*.a

__pycache__/
.pytest_cache/

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

### Python Patch ###
.venv/

# End of https://www.gitignore.io/api/python
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/ParallelWaveGAN"]
path = tools/ParallelWaveGAN
url = [email protected]:kan-bayashi/ParallelWaveGAN.git
Empty file added CHANGES.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Kazuhiro Kobayashi <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
149 changes: 148 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,148 @@
# crank
# Crank

Non-parallel voice conversion based on vector-quantized variational autoencoder

## Setup

- Install Python dependency

```sh
$ git clone https://github.com/k2kobayashi/crank.git
$ cd crank/tools
$ make
```

## Run VCC2020 recipe

crank has prepared recipe for Voice Conversion Challenge 2020.
In crank recipe, there are 6 steps to implement non-parallel voice conversion.

- stage 0
- download dataset
- stage 1
- initialization
- generate scp files and figures to be determine speaker-dependent parameters
- stage 2
- feature extraction
- extract mlfb and mcep features
- stage 3
- training
- stage 4
- reconstuction
- generate reconstructed feature for fine-tuning of neural vocoder
- stage 5
- evaluation
- convert evaluation feature


### Put dataset to downloads

Note that dataset is only released for the participants (2020/05/26).
```
$ cd egs/vaevc/vcc2020v1
$ mkdir downloads && cd downloads
$ mv <path_to_zip>/vcc2020_{training,evaluation}.zip downloads
$ unzip vcc2020_training.zip
$ unzip vcc2020_evaluation.zip
```

### Run feature extraction and model training

Because the challenge defines its training and evaluation set, we have initially put configuration files.
So, you need to run from 2nd stage.

```sh
$ ./run.sh --n_jobs 10 --stage 2 --stop_stage 5
```

where the ```n_jobs``` indicates the number of CPU cores used in the training.

### Integration neural vocoder [\(kan-bayashi/ParallelWaveGAN\)](https://github.com/kan-bayashi/ParallelWaveGAN)
Comming soon!!

## Samples
Comming soon!!

## Configuration
Configurations are defined in ```conf/default.yml```.
Followings are explanation of representative parameters.

- feature

When you create your own recipe, be carefull to set feature extraction settings such as ```fftl```, ```hop_size```, ```fs```, ```shiftms```, and ```mcep_apha```. These parameters usually depend on sampling frequency.

- feat_type

You can choose ```feat_type``` either ```mlfb``` or ```mcep```.
If you choose ```mlfb```, the converted waveforms are generated by GllifinLim vocoder.
If you choose ```mcep```, the converted waveforms are generated by world vocoder (i.e., excitation generation and MLSA filtering).

- trainer_type

We support training with ```vqvae```, ```lsgan```, ```cycle```, ```cyclegan``` using same generator network.
- ```vqvae```: default vqvae setting
- ```lsgan```: vqvae with adversarial learning
- ```cycle```: vqvae with cyclic constraints
- ```cyclegan```: vqvae with adevesarial learning and cyclic constraints

## Create your recipe

### Copy recipe template

Please copy template directory to start creation of your recipe.

```sh
$ cp -r egs/vaevc/template egs/vaevc/<new_recipe>
$ cd egs/vaevc/<new_recipe>
```

### Put .wav files

You need to put wav files appropriate directory.
You can choose either modifying ```download.sh``` or putting wav files.
In either case, the wav files should be located in each speaker like following
```<new_recipe>/downloads/wav/{spkr1, spkr2, ..., spkr3}/*.wav```.

If you modify ```downaload.sh```,

```sh
$ vim local/download.sh
```

If you put wav files,

```sh
$ mkdir downloads
$ mv <path_to_your_wav_directory> downloads/wav
$ touch downloads/.done
```

### Run initialization

The initialization process generates kaldi-like scp files.

```sh
$ ./run.sh --stage 1 --stop_stage 1
```

Then you modify speaker-dependent parameters in ```conf/spkr.yml``` using generated figures.
Page 20~22 in [slide](https://www.slideshare.net/NU_I_TODALAB/hands-on-voice-conversion) help you how to set these parameters.


### Run feature extraction, train, reconstruction, and evaluation

After preparing configuration, you run it.

```sh
$ ./run.sh --stage 2 --stop_stage 5
```

## Achknowledgements

Thank you [@kan-bayashi](https://github.com/kan-bayashi) for lots of contributions and encouragement helps.

## Who we are

- Kazuhiro Kobayashi [@k2kobayashi](https://github.com/k2kobayashi) [maintainer, design and development]

- [Tomoki Toda](https://sites.google.com/site/tomokitoda/) [advisor]
Loading

0 comments on commit 1e59783

Please sign in to comment.