a210090033
- Add new pretrained model to ./models/upconv_7 - Move old models to ./models/vgg_7 - Use nn.LeakyReLU instead of w2nn.LeakyReLU - Add useful attribute to .json New JSON attribute: The first layer has `model_config` attribute. It contains: model_arch: architecture name of model. see `lib/srcnn.lua` scale_factor: if scale_factor > 1, model:forward() changes image resolution with scale_factor. channels: input/output channels. if channels == 3, model is RGB model. offset: pixel size that is to be removed from output. for example: (scale_factor=1, offset=7, input=100x100) => output=(100-7)x(100-7) (scale_factor=2, offset=12, input=100x100) => output=(100*2-12)x(100*2-12) And each layer has `class_name` attribute.
23 lines
1 KiB
Bash
Executable file
23 lines
1 KiB
Bash
Executable file
#!/bin/sh -x
|
|
|
|
# maybe 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}/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
|
|
}
|
|
rebuild vgg_7/art vgg_7
|
|
rebuild vgg_7/art_y vgg_7
|
|
rebuild vgg_7/photo vgg_7
|
|
rebuild vgg_7/ukbench vgg_7
|
|
rebuild upconv_7/art upconv_7
|