Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import argparse
import sys
import numpy as np
import pygame.midi
import pyaudio
@ohtaman
ohtaman / np_array_from_address.py
Created May 20, 2017 14:58
メモリのアドレスからnp.arrayを生成
from ctypes import c_char_p, c_byte, cast, ARRAY, POINTER
import numpy as np
a = np.array(list(range(10)), dtype=np.uint8)
a_addr = a.__array_interface__['data'][0]
size = len(a)
a_char_p = c_char_p(a_addr)
a_byte_array = cast(a_char_p, POINTER(ARRAY(c_byte, len=size))).contents
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ohtaman
ohtaman / index.html
Last active October 8, 2017 19:17
simple deeplearn.js example
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/deeplearn"></script>
</head>
<body>
<h1>deeplearn.js ちょっと試してみる用</h1>
</body>
</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ohtaman
ohtaman / Dockerfile
Created December 13, 2019 22:26
TensorFlow Hub + Cloud Run
FROM python:3.7
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . .
RUN pip install Flask gunicorn tensorflow tensorflow-hub tensorflow_text>=2.0.0rc0
RUN python load_module.py
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app
@ohtaman
ohtaman / Shredder_DevFest2020
Last active October 17, 2020 00:49
Shredder_DevFest2020_Routing
Demos for DevFest 2020
This file has been truncated, but you can view the full file.
.net ネット
a.p. indy エーピーインディ
a.p.p.p. アナザープッシュピンプランニング
adk エーディーケイ
adox アドックス
aeiou アエイオウ
aidacara アイーダカラ
aidadiva アイーダディーヴァ
aix エクス
ambn アメロブラスチン
@ohtaman
ohtaman / edgetpu-with-keras.ipynb
Last active May 2, 2021 13:23
EdgeTPU with Keras
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.