This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image/color" | |
"log" | |
"github.com/disintegration/imaging" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
dir = "./movie" | |
def main(): | |
files = os.listdir(dir) | |
with open('dap.txt', 'w') as of: | |
for i, file in enumerate(files): | |
mpath = os.path.join(dir, file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
num_movie = 10 | |
for i in range(num_movie): | |
# movie file dir %03d | |
dir = "%03d" % (i+1) | |
print(dir) | |
files = os.listdir(dir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# signal is audio time series data. | |
# bands mel power spec dim axis 0. | |
y_harmonic, y_percussive = librosa.effects.hpss(signal) | |
S_harmonic = librosa.feature.melspectrogram(y_harmonic, n_mels=bands, sr=sample_rate) | |
S_percussive = librosa.feature.melspectrogram(y_percussive, n_mels=bands, sr=sample_rate) | |
log_Sh = librosa.logamplitude(S_harmonic, ref_power=np.max) | |
log_Sp = librosa.logamplitude(S_percussive, ref_power=np.max) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def train(): | |
with tf.Graph().as_default(): | |
# 初期化オペレーション | |
init_op = tf.initialize_all_variables() | |
# Session | |
sess = tf.Session(config=tf.ConfigProto(log_device_placement=LOG_DEVICE_PLACEMENT)) | |
sess.run(init_op) | |
all_variables = tf.all_variables() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%timeit iter_generate.test_range() | |
1 loop, best of 3: 7.06 s per loop | |
%timeit iter_generate.test_xrange() | |
1 loop, best of 3: 4.59 s per loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" インタープリターの実行 | |
autocmd BufNewFile,BufRead *.rb nnoremap <C-e> :!ruby % | |
autocmd BufNewFile,BufRead *.py nnoremap <C-e> :!python % | |
autocmd BufNewFile,BufRead *.pl nnoremap <C-e> :!perl % | |
" 表示のカスタマイズ | |
set number "行番号を表示する | |
set title "編集中のファイル名を表示 | |
set showmatch "括弧入力時の対応する括弧を表示 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ipython | |
import name_space | |
%timeit name_space.test1_repeat() | |
1 loops, best of 3: 13.1 s per loop | |
%timeit name_space.test2_repeat() | |
1 loops, best of 3: 11.9 s per loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 0 LOAD_GLOBAL 0 (math) | |
3 LOAD_ATTR 1 (sin) | |
6 LOAD_FAST 0 (x) | |
9 CALL_FUNCTION 1 | |
12 RETURN_VALUE | |
10 0 LOAD_GLOBAL 0 (sin) | |
3 LOAD_FAST 0 (x) | |
6 CALL_FUNCTION 1 | |
9 RETURN_VALUE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 0x10100101 | |
269484289 | |
>> 0x10100101 & 0x111 | |
257 | |
>> 0x101 | |
257 |
NewerOlder