ProGamerGov / neural-style-pt

PyTorch implementation of neural style transfer algorithm
MIT License
833 stars 178 forks source link

Saving Models #53

Closed spot92 closed 4 years ago

spot92 commented 4 years ago

So I am 99% certain that the answer is that we can not save models, but I have to ask. Is it possible? Don't get me wrong, I get way better results here than I do with something like the repo below, but it would help with styling larger images and videos. If it's not possible, now worries, still love it.

https://github.com/lengstrom/fast-style-transfer

ProGamerGov commented 4 years ago

It's certainly possible, but I'm not sure why someone would want to do that. The models never actually learn anything themselves, as they're completely frozen. It also takes about a second at most to load all the images into the model, so you aren't really going to gain anything speed wise as well. Some of the parameters also rely on manipulating an image before it's stored inside the model (content/style layers).

Fast style transfer is an offshoot of regular style transfer. It trades quality and flexibility for speed (once you've spent time training the model with specific parameters).

JCBrouwer commented 4 years ago

To expand on @ProGamerGov, the models fast-style-transfer saves aren't the same as the models this repo uses to optimize the output image.

Fast style is teaching a new network to approximate the slow optimization that this repo does. This will always create a quality tradeoff as the newly trained model is more general.

One interesting path I'm not sure if anyone has tried is to train a fast-style model on multiscale generated pictures instead of single scale. If you ask me, though, the best "fast style" results are from training CycleGANs