Skip to content

Instantly share code, notes, and snippets.

Avatar

Hiroshiba Hiroshiba

  • Japan
View GitHub Profile
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
}
@Hiroshiba
Hiroshiba / file_snippet.sh
Created Oct 23, 2018
ファイル周りのスニペット
View file_snippet.sh
# findで見つけたファイルの最新-最古unixタイムを得るコマンド
echo `find [dir] [filter] -printf '%C@\n' | sort | awk 'NR==1; END{print}'` | awk '{print ($2 - $1)}'
View use_crepe.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hiroshiba
Hiroshiba / rsync-xargs-pull.sh
Created Mar 31, 2018
rsync + xargs download
View rsync-xargs-pull.sh
rsync-xargs-pull () {
d=$2; d=${d%/*}
rsync --dry-run -av $1:$2 $3 | xargs -n128 -P1 -I@ rsync -avR $1:$d/./@ $3
}
@Hiroshiba
Hiroshiba / chainer_log_to_csv.py
Created Mar 6, 2018
chainerのjsonログファイルをcsv形式に変換する
View chainer_log_to_csv.py
"""
python chainer_log_to_csv.py [input path] [output path]
"""
import argparse
import csv
import json
parser = argparse.ArgumentParser()
parser.add_argument('input')
You can’t perform that action at this time.