{ "cells": [ { "cell_type": "markdown", "id": "ee1eef4e", "metadata": {}, "source": [ "# NNSVS demos \n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nnsvs/nnsvs/blob/master/notebooks/Demos.ipynb)\n", "\n", "\n", "Singing voice synthesis (SVS) demo using nnsvs. All the models were trained using https://github.com/nnsvs/nnsvs. Recipes to reproduce experiments are included in the repository.\n", "\n", "NOTE: Due to the license issues, pre-trained models are not provided except for the ones trained on NIT-song070 database. The use of pre-traiend models are only permitted for research purpose." ] }, { "cell_type": "markdown", "id": "7ffdb4e4", "metadata": {}, "source": [ "## Preparation" ] }, { "cell_type": "code", "execution_count": 1, "id": "2978569c", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%capture\n", "try:\n", " import nnsvs\n", "except ImportError:\n", " ! pip install git+https://github.com/nnsvs/nnsvs" ] }, { "cell_type": "code", "execution_count": 2, "id": "2f69e83e", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "%pylab is deprecated, use %matplotlib inline and import the required libraries.\n", "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "%pylab inline\n", "%load_ext autoreload\n", "%autoreload\n", "import IPython\n", "from IPython.display import Audio\n", "import pysinsy\n", "import librosa\n", "from nnmnkwii.io import hts" ] }, { "cell_type": "code", "execution_count": 3, "id": "70ea3c3d", "metadata": { "tags": [] }, "outputs": [], "source": [ "from nnsvs.pretrained import create_svs_engine\n", "import nnsvs" ] }, { "cell_type": "markdown", "id": "1bd1ac38", "metadata": {}, "source": [ "## Sample 1" ] }, { "cell_type": "code", "execution_count": 5, "id": "d23193f1", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "engine = create_svs_engine(\"r9y9/yoko_latest\")\n", "\n", "contexts = pysinsy.extract_fullcontext(nnsvs.util.example_xml_file(\"song070_f00001_063\"))\n", "labels = hts.HTSLabelFile.create_from_contexts(contexts)\n", "wav, sr = engine.svs(labels)\n", "\n", "Audio(wav, rate=sr)" ] }, { "cell_type": "markdown", "id": "24832985", "metadata": {}, "source": [ "## References\n", "\n", "- nnsvs: https://github.com/nnsvs/nnsvs" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 5 }