Skip to content

Instantly share code, notes, and snippets.

View lilacs2039's full-sized avatar
💭
trying Pix2Pix on Voice Data

lilacs lilacs2039

💭
trying Pix2Pix on Voice Data
View GitHub Profile
@lilacs2039
lilacs2039 / checkImagesChannels.py
Created September 17, 2017 05:52
指定したフォルダ内の画像ファイルのファイル名・幅・高さ・チャネル数・データタイプをファイルに上書き保存
"""
指定したフォルダ内の画像ファイルのファイル名・幅・高さ・チャネル数・データタイプをファイルに上書き保存
USAGE
python checkImagesChannels --dir path/to/imgs
"""
import argparse
import glob
@lilacs2039
lilacs2039 / taggingImages.py
Created September 18, 2017 05:20
illustration2vecを使用して、指定フォルダ内の全画像をタグ付け
"""
指定ディレクトリのすべての画像ファイルに対してタグ付けして結果をファイルに保存
Usage:
python taggingImages.py --image_dir path/to/images
"""
import argparse
import glob
@lilacs2039
lilacs2039 / taggingImages_withProbability.py
Last active December 10, 2017 02:41
i2vを使用して、指定ディレクトリのすべての画像ファイルに対して画像種類のタグを付けて結果をファイルに保存。タグの確からしさ(0~1)も保存
#coding:utf-8
"""
i2vを使用して、指定ディレクトリのすべての画像ファイルに対して画像種類のタグを付けて結果をファイルに保存
タグの確からしさ(0~1)も保存
Usage:
python taggingImages.py --image_dir path/to/images
"""
import argparse
@lilacs2039
lilacs2039 / ParameterDefinition.py
Last active October 4, 2017 16:34
パラメータ記述用オブジェクト デフォルトパラメータ付き (あるいはDTO : Data Transfer Object)
"""
↓を参考に、デフォルトパラメータ機能もつけた
参考:http://python-3-patterns-idioms-test.readthedocs.io/en/latest/Messenger.html
"""
class EncDecParam:
def __init__(self,**kwargs):
default_param= {"block":0,"each_block_shortcut":True,"global_ShortCut":False,"en_batch_norm":True,"downScale_conv_kernel":3}
for k,v in default_param.items():
self.__dict__[k] =kwargs.get(k,v)
@lilacs2039
lilacs2039 / file0.txt
Last active December 9, 2017 13:45
WEBDNNのWebAssemblyコンパイル環境をDockerで用意 ref: https://qiita.com/lilacs/items/90c08538283918902d69
# (事前にカレントディレクトリを変換したいモデルのあるディレクトリへ移動すること)
docker run --rm -v "$(pwd):/src" -it lilacs2039/debian_webasm_webdnn
python /webdnn/bin/convert_keras.py resnet50.h5 --input_shape '(1,224,224,3)' --out output --backend webassembly
@lilacs2039
lilacs2039 / file0.txt
Created December 9, 2017 13:42
WEBDNNのRESNET50チュートリアルをDocker環境で試す(WebAssemblyのみ) ref: https://qiita.com/lilacs/items/c6fc8c0178a9563c0e2a
git clone --depth 1 https://github.com/mil-tokyo/webdnn webdnn
cd webdnn
docker run --rm -v "$(pwd):/src" -it lilacs2039/debian_webasm_webdnn
# in container...
cd /src/example/resnet && python convert_resnet_keras.py --backend webassembly
# exit
docker run --rm -p 8080:80 -v "$(pwd):/usr/local/apache2/htdocs/" httpd
@lilacs2039
lilacs2039 / scrapingImage.py
Created July 28, 2018 01:28
マルチスレッドでリンクをたどりながら画像を収集
# coding:utf-8
"""
マルチスレッドでリンクをたどりながら画像を収集
Usage:
python scrapingImage.py --target_urls (対象URL) --save_dir images
↓を参考に加筆したもの
http://www.mathgram.xyz/entry/scraping/matome
"""
@lilacs2039
lilacs2039 / appState.cs
Last active August 31, 2018 17:25
C#のenumにフィールド・メソッドを定義したいとき【JavaからC#へ】 ref: https://qiita.com/lilacs/items/167a73fbbfedf83eb51a
public enum AppState
{
Active, Paused, Exit
}
public static class AppStateExt
{
private static Dictionary<AppState, string> viewStrDictionary = new Dictionary<AppState, string>()
{
{AppState.Active,"アクティブ" },
{AppState.Paused,"ポーズ" },
@lilacs2039
lilacs2039 / LICENSE
Last active November 22, 2019 11:23
UNLICENSE is applied to all my public gists. https://gist.github.com/lilacs2039
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@lilacs2039
lilacs2039 / listup_officeFiles.py
Created November 22, 2019 11:21
List up the MS Office files in sub folders, then output a html file.
"""
"""
# Variables
outFilename = "FileList.html"
outFilename_withFullpathStr = "FileList_withFullPath.html"
exts = ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.msg']
# Programs **************
from pathlib import Path
#reference: https://qiita.com/amowwee/items/e63b3610ea750f7dba1b