Skip to content

Instantly share code, notes, and snippets.

@tam17aki
tam17aki / gmhd_demo_many_datasets.ipynb
Last active December 16, 2023 14:51
Generalized Mahalanobis depth in the reproducing kernel Hilbert space (GMHD) in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
"""音声パワーと基本周波数をリアルタイムモニタリングする.
Copyright (C) 2023 by Akira TAMAMORI
Copyright (C) 2022 by Koji INOUE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tam17aki
tam17aki / krpd.py
Last active November 23, 2023 11:25
Outlier Detector based on Kernel Random Projection Depth (KRPD). https://arxiv.org/abs/2306.07056
# -*- coding: utf-8 -*-
"""Outlier Detector based on Kernel Random Projection Depth (KRPD).
Copyright (C) 2023 by Akira TAMAMORI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
# メロディ推定のデモンストレーション
# brew install timidity
# brew install libsndfile
# pip install tensorflow
# pip install tensorflow_hub
# pip install music21
# pip install pydub
import math
# Copyright (c) 2023 Blake Mallory
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
from pathlib import Path
from voicevox_core import AccelerationMode, VoicevoxCore
import sounddevice as sd
import soundfile as sf
SPEAKER_ID = 2 # 話者IDを指定
open_jtalk_dict_dir = './open_jtalk_dic_utf_8-1.11'
text = 'これは音声合成のデモンストレーションです。'
OUTPUT_WAV = 'output.wav'
#!/bin/bash
brew install wget
wget https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-arm64-1.13.1.tgz
tar xvzf onnxruntime-osx-arm64-1.13.1.tgz
mv onnxruntime-osx-arm64-1.13.1/lib/libonnxruntime.* ./
wget http://downloads.sourceforge.net/open-jtalk/open_jtalk_dic_utf_8-1.11.tar.gz
tar xvzf open_jtalk_dic_utf_8-1.11.tar.gz
#!/bin/bash
# for MacOS
brew install wget
pip3 install vosk
pip3 install sounddevice
wget https://alphacephei.com/vosk/models/vosk-model-small-ja-0.22.zip
@tam17aki
tam17aki / feat_speech_mos.ipynb
Created September 4, 2023 07:27
feat_speech_mos.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tam17aki
tam17aki / entropic_clustering_faster.py
Last active August 26, 2023 09:24
A demo script of "Differential Entropic Clustering of Multivariate Gaussians" in Python. This is a faster version thanks to numba and jit.
"""A demo script of "Differential Entropic Clustering of Multivariate Gaussians".
Copyright (C) 2023 by Akira TAMAMORI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: