diff --git a/.gitignore b/.gitignore index 7cbde17..9c418f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ cache/*.png +waifu2x.log diff --git a/appendix/cache_cleaner.lua b/appendix/cache_cleaner.lua new file mode 100644 index 0000000..fa81be5 --- /dev/null +++ b/appendix/cache_cleaner.lua @@ -0,0 +1,12 @@ +require 'pl' + +CACHE_DIR="cache" +TTL = 3600 * 24 + +local files = dir.getfiles(CACHE_DIR, "*.png") +local now = os.time() +for i, f in pairs(files) do + if now - path.getmtime(f) > TTL then + file.delete(f) + end +end diff --git a/appendix/run-web.sh b/appendix/run-web.sh new file mode 100644 index 0000000..03c32ab --- /dev/null +++ b/appendix/run-web.sh @@ -0,0 +1,4 @@ +#!/bin/zsh +# waifu2x daemon script +source /home/ubuntu/.zshrc +stdbuf -o 0 th web.lua >> ./waifu2x.log 2>&1 diff --git a/appendix/waifu2x.upstart.conf b/appendix/waifu2x.upstart.conf new file mode 100644 index 0000000..86b0eff --- /dev/null +++ b/appendix/waifu2x.upstart.conf @@ -0,0 +1,11 @@ +# waifu2x upstart script + +description "waifu2x" +author "nagadomi@nurs.or.jp" +start on runlevel [2345] +stop on runlevel [016] +setuid ubuntu +setgid ubuntu +chdir /home/ubuntu/waifu2x +exec ./appendix/run-web.sh +respawn diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/gen.sh b/images/gen.sh new file mode 100644 index 0000000..00b14ee --- /dev/null +++ b/images/gen.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +th waifu2x.lua -noise_level 1 -m noise_scale -i images/miku_small.png -o images/miku_small_waifu2x.png +th waifu2x.lua -noise_level 2 -m noise_scale -i images/miku_small_noisy.png -o images/miku_small_noisy_waifu2x.png +th waifu2x.lua -noise_level 2 -m noise -i images/miku_noisy.png -o images/miku_noisy_waifu2x.png +th waifu2x.lua -noise_level 2 -m noise_scale -i images/miku_CC_BY-NC_noisy.jpg -o images/miku_CC_BY-NC_noisy_waifu2x.png +th waifu2x.lua -noise_level 2 -m noise -i images/lena.png -o images/lena_waifu2x.png diff --git a/images/lena.png b/images/lena.png new file mode 100644 index 0000000..f1625dc Binary files /dev/null and b/images/lena.png differ diff --git a/images/lena_waifu2x.png b/images/lena_waifu2x.png new file mode 100644 index 0000000..5d9ea48 Binary files /dev/null and b/images/lena_waifu2x.png differ diff --git a/images/miku_CC_BY-NC.jpg b/images/miku_CC_BY-NC.jpg new file mode 100644 index 0000000..f0b488b Binary files /dev/null and b/images/miku_CC_BY-NC.jpg differ diff --git a/images/miku_CC_BY-NC_noisy.jpg b/images/miku_CC_BY-NC_noisy.jpg new file mode 100644 index 0000000..4f00774 Binary files /dev/null and b/images/miku_CC_BY-NC_noisy.jpg differ diff --git a/images/miku_CC_BY-NC_noisy_lanczos3.png b/images/miku_CC_BY-NC_noisy_lanczos3.png new file mode 100644 index 0000000..bfc2035 Binary files /dev/null and b/images/miku_CC_BY-NC_noisy_lanczos3.png differ diff --git a/images/miku_CC_BY-NC_noisy_waifu2x.png b/images/miku_CC_BY-NC_noisy_waifu2x.png new file mode 100644 index 0000000..f5a520e Binary files /dev/null and b/images/miku_CC_BY-NC_noisy_waifu2x.png differ diff --git a/images/miku_bg.png b/images/miku_bg.png new file mode 100644 index 0000000..0ea0d90 Binary files /dev/null and b/images/miku_bg.png differ diff --git a/images/miku_noisy.jpg b/images/miku_noisy.jpg new file mode 100644 index 0000000..c337de7 Binary files /dev/null and b/images/miku_noisy.jpg differ diff --git a/images/miku_noisy.png b/images/miku_noisy.png new file mode 100644 index 0000000..e91f37f Binary files /dev/null and b/images/miku_noisy.png differ diff --git a/images/miku_noisy_selective_blur.png b/images/miku_noisy_selective_blur.png new file mode 100644 index 0000000..a846524 Binary files /dev/null and b/images/miku_noisy_selective_blur.png differ diff --git a/images/miku_noisy_waifu2x.png b/images/miku_noisy_waifu2x.png new file mode 100644 index 0000000..43760d5 Binary files /dev/null and b/images/miku_noisy_waifu2x.png differ diff --git a/images/miku_small.png b/images/miku_small.png new file mode 100644 index 0000000..17cd2a9 Binary files /dev/null and b/images/miku_small.png differ diff --git a/images/miku_small_hq2x.png b/images/miku_small_hq2x.png new file mode 100644 index 0000000..8f8cab6 Binary files /dev/null and b/images/miku_small_hq2x.png differ diff --git a/images/miku_small_lanczos3.png b/images/miku_small_lanczos3.png new file mode 100644 index 0000000..3b92e90 Binary files /dev/null and b/images/miku_small_lanczos3.png differ diff --git a/images/miku_small_noisy.jpg b/images/miku_small_noisy.jpg new file mode 100644 index 0000000..db3b4c9 Binary files /dev/null and b/images/miku_small_noisy.jpg differ diff --git a/images/miku_small_noisy.png b/images/miku_small_noisy.png new file mode 100644 index 0000000..d9d91e1 Binary files /dev/null and b/images/miku_small_noisy.png differ diff --git a/images/miku_small_noisy_lanczos3.png b/images/miku_small_noisy_lanczos3.png new file mode 100644 index 0000000..2c06394 Binary files /dev/null and b/images/miku_small_noisy_lanczos3.png differ diff --git a/images/miku_small_noisy_waifu2x.png b/images/miku_small_noisy_waifu2x.png new file mode 100644 index 0000000..781553c Binary files /dev/null and b/images/miku_small_noisy_waifu2x.png differ diff --git a/images/miku_small_waifu2x.png b/images/miku_small_waifu2x.png new file mode 100644 index 0000000..0d71947 Binary files /dev/null and b/images/miku_small_waifu2x.png differ diff --git a/images/slide.odp b/images/slide.odp new file mode 100644 index 0000000..fd7b3a9 Binary files /dev/null and b/images/slide.odp differ diff --git a/images/slide.png b/images/slide.png new file mode 100644 index 0000000..f434e02 Binary files /dev/null and b/images/slide.png differ diff --git a/images/slide_noise_reduction.png b/images/slide_noise_reduction.png new file mode 100644 index 0000000..6a04b9f Binary files /dev/null and b/images/slide_noise_reduction.png differ diff --git a/images/slide_result.png b/images/slide_result.png new file mode 100644 index 0000000..22b2259 Binary files /dev/null and b/images/slide_result.png differ diff --git a/images/slide_tone.png b/images/slide_tone.png new file mode 100644 index 0000000..3278db1 Binary files /dev/null and b/images/slide_tone.png differ diff --git a/images/slide_upscaling.png b/images/slide_upscaling.png new file mode 100644 index 0000000..1cbf0b7 Binary files /dev/null and b/images/slide_upscaling.png differ diff --git a/images/tone.png b/images/tone.png new file mode 100644 index 0000000..f303835 Binary files /dev/null and b/images/tone.png differ diff --git a/images/tone_waifu2x.png b/images/tone_waifu2x.png new file mode 100644 index 0000000..82a3047 Binary files /dev/null and b/images/tone_waifu2x.png differ diff --git a/images/tone_waifu2x_downscale.png b/images/tone_waifu2x_downscale.png new file mode 100644 index 0000000..76ea8d5 Binary files /dev/null and b/images/tone_waifu2x_downscale.png differ