Skip to content

Instantly share code, notes, and snippets.

View leetmikeal's full-sized avatar

Teppei Tamaki leetmikeal

  • Taktpixel Co., Ltd.
  • Yokohama, Japan
  • X @tpxtamaki
View GitHub Profile
@leetmikeal
leetmikeal / build.sh
Created December 16, 2022 00:47
pyinstaller TensorFlow test
pip install pip-tools pyinstaller
pip-compile requirements.in
pip install -r requirements.txt
pyinstaller test.py --onefile
@leetmikeal
leetmikeal / image_pair_rename.sh
Created May 22, 2021 07:06
mabling_py image to pair image
#!/bin/bash
set -eu
files=$(find ./ -name "*[0-9]_d.png" -type f)
for f in ${files[@]}; do
echo ${f}
num=$(echo ${f} | sed -e 's/.*marbling_\([0-9]\+\)_d.png$/\1/g')
num_zero=$(printf "%010d" "$num")
newpath=$(echo ${f} | sed -e 's/\([0-9]\+\)_d.png$/'${num_zero}'_1t.png/g')
@leetmikeal
leetmikeal / compress_child_dir.sh
Created September 27, 2020 00:41
compress to zip to child directories by using 7-zip in Windows
#!/bin/bash
# to install 7-zip
# https://www.7-zip.org/
#
# open directory by cygwin or git-bash
# and run 'sh compress_child_dir.sh'
set -eu
@leetmikeal
leetmikeal / settings.json
Created September 14, 2020 08:40
Windows VSCode settings for Vim extension
{
"vim.handleKeys": {
"<C-a>": false,
"<C-f>": false
},
}
@leetmikeal
leetmikeal / combine_path.php
Last active April 12, 2020 02:19
Combine mutiple strings to path
<?php
/**
* Combine mutiple strings to path
* @param string $arg1 first path string
* @param string $args path string array
* @return string connected path
*/
function combinePath(string $arg1, string ...$args): string {
$path = $arg1;
@leetmikeal
leetmikeal / numpy_loadsave.py
Created June 13, 2018 23:24
numpyのload/saveにて複数の配列をまとめて行う場合と個別に行う場合の速度を比較
import sys
import os
import numpy as np
import cv2
from datetime import datetime
def judge_iter(s):
return hasattr(s, '__iter__') and not('str' in str(type(s)))
def get_image_list(path):
@leetmikeal
leetmikeal / remove_not_readable_image.py
Created June 13, 2018 11:20
指定したフォルダ配下の読み込み不可の画像ファイルを削除する
import os
import sys
import cv2
def enumerate_image(dirpath, imageext=[".tif", ".tiff", ".jpeg", ".jpg", ".png", ".bmp"]):
for f in os.listdir(dirpath):
fullpath = os.path.join(dirpath, f)
if os.path.isdir(fullpath):
for f in enumerate_image(fullpath):
yield f
@leetmikeal
leetmikeal / extract_copy_image.py
Created June 13, 2018 11:19
データセットから指定した数の画像を抽出してコピーする
import os
import sys
import random
import math
import shutil
SEED = 124512341
random.seed(SEED)
if __name__ == '__main__':
#/usr/bin/python
# -*- coding:utf-8 -*-
import pydoc
import string
class checkModule:
def __init__(self):
self.modules = []
pydoc.ModuleScanner().run(self.__callback, onerror=self.__onerror)
@leetmikeal
leetmikeal / file0.txt
Last active September 3, 2017 14:27
[入門] node.js 6.11 (Electron 1.8) + Typescript 2.4 (2017年9月時点最新の方法) ref: http://qiita.com/leetmikeal/items/c7b9b6669a16e7ef6eb0
$ node -v
v6.11.2
$ npm -v
3.10.10
$ tsc -v
Version 2.4.1