diff --git a/neural_style.lua b/neural_style.lua index 00b68f0..8fc6a9a 100644 --- a/neural_style.lua +++ b/neural_style.lua @@ -249,7 +249,10 @@ local function main(params) elseif params.init == 'image' then img = content_image_caffe:clone():float() else - error('Invalid init type') + -- Read other init arguments as path to initial image + local alternate_initial_image = image.load(params.init, 3) + alternate_initial_image = image.scale(alternate_initial_image, params.image_size, 'bilinear') + img = preprocess(alternate_initial_image):float() end if params.gpu >= 0 then if params.backend ~= 'clnn' then