Skip to content

Instantly share code, notes, and snippets.

View thkim-cochl's full-sized avatar
🤯

Taehun Kim thkim-cochl

🤯
View GitHub Profile
@thkim-cochl
thkim-cochl / tflite_test.py
Created March 12, 2019 08:51
tflite test
import numpy as np
import tensorflow as tf
import sox
import pyaudio
import librosa
import logging
import tempfile
import numpy as np
from pydub import AudioSegment
from six.moves import queue
@thkim-cochl
thkim-cochl / tflite_async_test.py
Created March 14, 2019 11:17
Event model TF lite test (async)
import os
import tempfile
import numpy as np
import tensorflow as tf
import sox
import pyaudio
import librosa
import logging
import tempfile
import numpy as np
@thkim-cochl
thkim-cochl / tflite_bath_model.py
Last active March 21, 2019 10:37
TF lite bath model test
import tensorflow as tf
import numpy as np
from keras.models import load_model
import time
event_list = ['bathhub', 'shower', 'sink', 'toiletflush', 'others']
input_shape = (1, 1, 110250)
def postprocessing(response):
response = np.reshape(response, (len(event_list)))
@thkim-cochl
thkim-cochl / get_mel.py
Last active May 22, 2019 12:50
Melspec example using tf 2.0 for GPU accelerating
import tensorflow as tf # >= 2.0.0-alpha0
import librosa
import numpy as np
import time
from os import listdir
from os.path import isfile, join
from os.path import splitext
tf.config.gpu.set_per_process_memory_fraction(0.9)
<Response>
<Say voice="alice">안녕하세요. </Say>
<Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>
#!/bin/bash
TARGET=android-26
INSTALLATION_PATH=`realpath .`/build
NDK_ROOT="/opt/android/android-ndk-r19c"
TOOLCHAIN=`pwd`/toolchains
OPENSSL_PATH="/home/brian/Projects/OpenSSL-for-Android-Prebuilt/openssl-1.1.1"
ZLIB_PATH="/opt/android/android-ndk-r19c/platforms/android-26/arch-arm/usr/lib"
$NDK_ROOT/build/tools/make-standalone-toolchain.sh --arch=arm --platform=$TARGET --install-dir=$TOOLCHAIN