Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to initialize image with arbitrary other image #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion neural_style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down