Skip to content

Instantly share code, notes, and snippets.

@Hiroshiba
Hiroshiba / generate.ipynb
Last active May 20, 2021
PySide2 Property Generator
View generate.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hiroshiba
Hiroshiba / 01.py
Created Apr 3, 2021
きりたん歌唱データベースにjuliusの音素アライメントを適用させるコードメモ
View 01.py
import subprocess
from pathlib import Path
lab = Path("01.lab.txt").read_text()
i = 0
out_labs = []
for l in lab.splitlines():
a, b, c = l.split()
if c == "pau":
View check_tpu.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View lab色空間的に等間隔なトーンもどき.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View juliusを使って音素アライメントする例.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hiroshiba
Hiroshiba / analyze.py
Created Jan 11, 2020
JVSデータでの話者re-identifierの精度評価
View analyze.py
from pathlib import Path
import numpy
from scipy.spatial.distance import cdist
def load_vector(path_format: Path):
predicted_vectors = []
true_speaker_nums = []
for speaker_num in range(100):
@Hiroshiba
Hiroshiba / analyze.py
Created Jan 7, 2020
JVSデータセットの無音ラベルがどれくらい合ってるのか評価
View analyze.py
from pathlib import Path
from typing import Union, Sequence
import librosa
import numpy
from librosa.effects import _signal_to_frame_nonsilent
from matplotlib import pyplot
from tqdm import tqdm
@Hiroshiba
Hiroshiba / main.py
Created Jul 31, 2019
`timeout-decorator` with `threading` or `multiprocessing`
View main.py
import multiprocessing
import threading
import time
import timeout_decorator
def countup():
for i in range(1, 10):
time.sleep(1)
@Hiroshiba
Hiroshiba / check.bash
Created Nov 27, 2018
pythonの簡単なファイルロック
View check.bash
for i in `seq 0 4`; do python check.py & done
# [1] 83406
# [2] 83407
# [3] 83408
# [4] 83409
# [5] 83410
# start sleep 0
# finish sleep 0
# start sleep 1
View .bash_profile
function hh-audio-movie () {
ffmpeg -y -i $1 \
-filter_complex "[0:a]showwaves=mode=p2p:s=hd480:colors=Cyan[v]" \
-map "[v]" -map 0:a -pix_fmt yuv420p \
-b:a 360k $2
}