forked from nagadomi/waifu2x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebuild_all.sh
executable file
·39 lines (35 loc) · 2.18 KB
/
rebuild_all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh -x
# you should backup models
rebuild() {
if [ -f models/${1}/scale2.0x_model.t7 ] && [ ! -h models/${1}/scale2.0x_model.t7 ] ; then
th tools/rebuild_model.lua -i models/${1}/scale2.0x_model.t7 -o models/${1}/scale2.0x_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise0_model.t7 ] && [ ! -h models/${1}/noise0_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise0_model.t7 -o models/${1}/noise0_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise1_model.t7 ] && [ ! -h models/${1}/noise1_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise1_model.t7 -o models/${1}/noise1_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise2_model.t7 ] && [ ! -h models/${1}/noise2_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise2_model.t7 -o models/${1}/noise2_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise3_model.t7 ] && [ ! -h models/${1}/noise3_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise3_model.t7 -o models/${1}/noise3_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise0_scale2.0x_model.t7 ] && [ ! -h models/${1}/noise0_scale2.0x_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise0_scale2.0x_model.t7 -o models/${1}/noise0_scale2.0x_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise1_scale2.0x_model.t7 ] && [ ! -h models/${1}/noise1_scale2.0x_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise1_scale2.0x_model.t7 -o models/${1}/noise1_scale2.0x_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise2_scale2.0x_model.t7 ] && [ ! -h models/${1}/noise2_scale2.0x_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise2_scale2.0x_model.t7 -o models/${1}/noise2_scale2.0x_model.t7 -backend cunn -model $2
fi
if [ -f models/${1}/noise3_scale2.0x_model.t7 ] && [ ! -h models/${1}/noise3_scale2.0x_model.t7 ]; then
th tools/rebuild_model.lua -i models/${1}/noise3_scale2.0x_model.t7 -o models/${1}/noise3_scale2.0x_model.t7 -backend cunn -model $2
fi
}
rebuild upconv_7/art upconv_7
rebuild vgg_7/art vgg_7
rebuild upconv_7/photo upconv_7
rebuild vgg_7/photo vgg_7