Parakeet/notebooks/spec_show.ipynb

172 lines
528 KiB
Plaintext
Raw Normal View History

2019-11-25 16:53:11 +08:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"import librosa\n",
"from librosa import display\n",
"from parakeet.datasets import ljspeech\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"ljspeech_dataset = ljspeech.LJSpeech(\"/workspace/datasets/LJSpeech-1.1/\")"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"example = ljspeech_dataset[0] # mag, mel, text"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(array([[ -0.27462918, -6.2973747 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ],\n",
" [ -0.27177352, -6.2941885 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ],\n",
" [ -0.26818287, -6.2838745 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ],\n",
" ...,\n",
" [ -0.2587558 , -6.2825537 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ],\n",
" [ -0.25943533, -6.2737536 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ],\n",
" [ -0.26199442, -6.2909927 , -48.616695 , ..., -48.616695 ,\n",
" -48.616695 , -48.616695 ]], dtype=float32), array([[0.7972537 , 0.7370262 , 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ],\n",
" [0.7972823 , 0.7370581 , 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ],\n",
" [0.7973182 , 0.7371613 , 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ],\n",
" ...,\n",
" [0.7974124 , 0.73717445, 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ],\n",
" [0.7974056 , 0.7372624 , 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ],\n",
" [0.7973801 , 0.73709005, 0.313833 , ..., 0.313833 , 0.313833 ,\n",
" 0.313833 ]], dtype=float32), array([43, 45, 36, 41, 47, 36, 41, 34, 58, 64, 36, 41, 64, 47, 35, 32, 64,\n",
" 42, 41, 39, 52, 64, 46, 32, 41, 46, 32, 64, 50, 36, 47, 35, 64, 50,\n",
" 35, 36, 30, 35, 64, 50, 32, 64, 28, 45, 32, 64, 28, 47, 64, 43, 45,\n",
" 32, 46, 32, 41, 47, 64, 30, 42, 41, 30, 32, 45, 41, 32, 31, 58, 64,\n",
" 31, 36, 33, 33, 32, 45, 46, 64, 33, 45, 42, 40, 64, 40, 42, 46, 47,\n",
" 64, 36, 33, 64, 41, 42, 47, 64, 33, 45, 42, 40, 64, 28, 39, 39, 64,\n",
" 47, 35, 32, 64, 28, 45, 47, 46, 64, 28, 41, 31, 64, 30, 45, 28, 33,\n",
" 47, 46, 64, 45, 32, 43, 45, 32, 46, 32, 41, 47, 32, 31, 64, 36, 41,\n",
" 64, 47, 35, 32, 64, 32, 51, 35, 36, 29, 36, 47, 36, 42, 41, 60, 1]))\n"
]
}
],
"source": [
"print(example)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f0f1fd73690>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAADrCAYAAABXYUzjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOy8V5Bl13Wm+R1/zj3Xe5M3b3pflVWoQhl4kARBEjSipJ6WF3sUrei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C0RplL8Z2aSCV3HhvC8jhuR79bhczFMS2rMOFShZdIhxgmk0UMcVu3WC/aLF+fZNWrf7J5tz7u0kigbBBaiTL1o3VB7rmnu86BKlAmw+uy/zmv3qWzW2L0kGbZ84H0NQoxc0MsUyEG29dBSCTD1FIWqS0IoGYSaXvJxmUjnw7AMeFUqnHxIkR3v27yl3PnT2/wPHFKK4L771TRDF0BBG6bYvnnksxl65R7lr0bYl6R8Svu1y+VCObNTh7UqfbF4maFvMnMly6YJEK21y/2Sc5mmP/9tbhcwKxCOGwhk93sS2HTr1Jt2MRigfvWlw+xO7KBsfPDJPN+cn+2lO8/eOVQ+ta0VRicR8Bv8SLv/IkjZrF/m4d5z5ByHPPjvDMXANB6PKDD4KEEtFDHfhDLbbX7tKqNQ6v8VwXM2hw8vnj3HpvFRgsVqFElPxkGknwkCUP068xEasQEOtIikNAN/D7P52o/JEAoYCINupnashGljxOPzlK8aBPqdjG6tuMn5ym27XpdW10v4n1MQPrwznTafXQfQoz00GmJgNc0FXyQzqXL1f5yleHub7U49lvnuPKxTV0v49OvUk4EcGn2sTVCpvVIVw
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display.specshow(example[0])"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f0f20c61b90>"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAADrCAYAAABXYUzjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOy8d5Rdx33n+am66d13Xw6dE7rRaDRyjsxBTCApUhJJWTnYlpOsGWls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6s6Y9UmRysPMlb857c0plIYZFXPkgn8k2BdWmNVwuPAQo1PDnyG2YbH09UJVqUlV9griEeHGc7ctXj9cLicVUnFSKrEzmyFVQmPHdnwPK/OCxXjzRprorddsN/R9D18rOczvCN+Z+t5pI1EUBNl7ktv4f8ZvZadecXGrGAkqbM5KzkuDyAF3NqZZHsuSkckZLd2FbaRYcBRnKiXzvMALbODNi1OwlC4oo7vF6mIBTLmwEXHZK78HIaQrNA7uTf/m0scHF2L0y1ydNs2d2d/g4FwFB2L4CJOyG3RO/jfVmT51EoNW381dfWKbAANt8BU5YXF46HySdLBtuRHMPUEUraUjxPpY0P6g+gCLE2RDLNsz9TojFVpsxtkTUVavrGiilkd5CIa66J5bu020YXibfadnKk1eKZ5koaoMJC+iZJq0BB1NC2BEPri3yuoMEsTl22xDt6ZuI3e9PWMJByebZ7mI9nr6VB5bkp9ijn3GJbR+q7T9iBJPWQwXmGyIfGV4BrjJtKx1Yttv9Y4zctJhJLcnf0NUpF+Xo+fJAK8ZAWcS2zCIU1OZVhQdbywzmB6D20
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display.specshow(example[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}