jcjohnson / fast-neural-style

Feedforward style transfer
4.29k stars 816 forks source link

Using two models at the same time #56

Open piteight opened 8 years ago

piteight commented 8 years ago

Hi :) In readme, there is an option for camera style transfer, for using more than one model to transfer style for an image. I tried to use it to fastneuralstyle, but it says, that the second model is invalid argument, or when I use it like that: th fast_neural_style.lua -model models/eccv16/stasio.t7;models/eccv16/V.t7 -input_image images/content.chickago.jpg -output_image dwas.jpg Writing output image to out.png bash: models/eccv16/V.t7: Permission denied It didnt wrote dwas.jpg, but out.jpg and used only first model for it. I tried to sudo this, but still permission is denied.

htoyryla commented 8 years ago

There is no option for using multiple models in fast_neural_style.lua, as far as I can see in the code. The whole model parameter string is passed on to torch.load which is expected to return a single model.

It appears to me that your command is split into two at the semicolon, so fast-neural-style.lua gets run with only the -model param up to the semicolon. That's why the other parameters are ignored. Then when the script is finished, bash tries to run the rest, and because models/eccv16/V.t7 can not be run you get permission denied.

What do you expect such an option would do? Produce an image containing the two transformed images (like in webcam demo)? Or applying both style transfers one after another?

piteight commented 8 years ago

Thanks for reply :) I was thinking about something like merging two t7 models, so some parameters would cause effect of one style, but some details in picture would be like other style. I dont have webcam, so I misunderstood the way this script works.