Skip to content

Instantly share code, notes, and snippets.

@m77so
Last active May 6, 2023 08:09
Show Gist options
  • Select an option

  • Save m77so/5b234b50eaf576a058ad9a4eb17022b0 to your computer and use it in GitHub Desktop.

Select an option

Save m77so/5b234b50eaf576a058ad9a4eb17022b0 to your computer and use it in GitHub Desktop.
Julius 音素セグメンテーション.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyO7Ks1AQGAnip4d9/oTH0TH",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/m77so/5b234b50eaf576a058ad9a4eb17022b0/julius.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"JuliusのGPU版をビルドします\n",
"\n",
"参考: https://qiita.com/saliton/items/8afff6102f8c720975f2"
],
"metadata": {
"id": "ogdvAOJGFk-v"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "OtzgpWRSFb30"
},
"outputs": [],
"source": [
"!apt-get install build-essential zlib1g-dev libsdl2-dev\n",
"%cd /content\n",
"!git clone https://github.com/julius-speech/julius.git\n",
"%cd /content/julius\n",
"!CC=/usr/local/cuda-11.8/bin/nvcc CFLAGS=-O3 ./configure\n",
"!make\n",
"!make install"
]
},
{
"cell_type": "markdown",
"source": [
"segmentation-kit をダウンロードして、実行ファイルを置き換えます。\n",
"最新版(4.6)のJuliusを使いますが、segmentation-kit では4.3.1とソースコードに書かれているので合わせる(気になるようなら直してください)"
],
"metadata": {
"id": "LbXV6p9MGIay"
}
},
{
"cell_type": "code",
"source": [
"%cd /content/\n",
"!git clone https://github.com/julius-speech/segmentation-kit.git\n",
"!cp /content/julius/julius/julius /content/segmentation-kit/bin/julius-4.3.1"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "DhID-828GCEV",
"outputId": "71487d5c-802c-4aea-e472-69c35023d5a2"
},
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content\n",
"Cloning into 'segmentation-kit'...\n",
"remote: Enumerating objects: 56, done.\u001b[K\n",
"remote: Total 56 (delta 0), reused 0 (delta 0), pack-reused 56\u001b[K\n",
"Unpacking objects: 100% (56/56), 2.95 MiB | 7.76 MiB/s, done.\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"segmentation-kit/wav 内のファイルに対して処理が行われる。"
],
"metadata": {
"id": "ZPbq_ZhnGefV"
}
},
{
"cell_type": "code",
"source": [
"%cd /content/segmentation-kit\n",
"!perl ./segment_julius.pl"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "xBVVEz3RGdB0",
"outputId": "c06357be-9fdc-4a67-fa02-b79bd60ba327"
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/segmentation-kit\n",
"./wav/sample.wav\n",
"enter filename->............................................................................................................................................................................................................enter filename->1 files processed\n",
"Result saved in \"./wav/sample.lab\".\n"
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment