Comments (6)
@7yl4r Due to the use of L-BFGS, very large images of the size 1000x1000 (for a square image) is too large, even for a 12 GB gpu ram card.
I suggest using Theano backend, and enable garbage collection. This should allow for slightly larger images to be styled, in exchange for speed. Even so, there is an upper limit to how large the image can be.
I found that for a 4 GB GPU, the upper limit on theano is 740x740 image. Tensorflow does not have garbage collection, I think. That may be the reason that it hits an OOM even at 700x700.
Even with a 12 GB card, I have not heard of anyone using L-BFGS for images larger than 1200x1200. However, with the adam optimizer, it is possible to use less memory to scale larger images, in exchange for quality. This repo doesn't support Adam optimizer, but if anyone wishes to add it, they can create a PR.
EDIT:
I really do suggest just using a 512 as the image size, and then upscale via a convolutional upscaling algorithm. waifu2x-caffe is added as a link at the bottom of the repo.
My workflow is basically -
- Create image at 512 image size
- Upscale 4x to 2048 px
- Apply denoising or sharpening if image quality is drastically poor, else leave it alone.
from neural-style-transfer.
How were the examples in the readme created? The first one is 2560x1600.
I think I'm misunderstanding something here.
from neural-style-transfer.
I added it to the edit, but to reiterate :
I really do suggest just using a 512 as the image size, and then upscale via a convolutional upscaling algorithm. waifu2x-caffe is added as a link at the bottom of the repo.
My workflow is basically -
- Create image at 512 image size
- Upscale 4x to 2048 px
- Apply denoising or sharpening if image quality is drastically poor, else leave it alone.
As you can see from the examples, waifu2x-caffe is a generally very useful tool to upscale stylized images. All the images in the readme were simply upscaled after generation. No cleaning or denoising applied.
from neural-style-transfer.
Interesting. I didn't realize you could achieve that quality upscaling.
Do you have any other tips for someone who is trying to generate the highest possible resolution image? Based on your suggestions my new plan is to see how large I can get using the theano backend and a cpu-capable machine to avoid GPU OOM errors and then upscale the output.
from neural-style-transfer.
@7yl4r CPU with this algorithm is a non-starter. It required over 4000 seconds per iteration on an i7 8 core machine (alienware laptop, so I can't speak for huge workstations with hundreds of cores and tons of RAM).
WIth Theano and garbage collection, and a 12 GB card, I have heard that image size of 1200x1200 can be achieved. Do note that this repo does not restrict to square images, so you are considering min image size
= 1200 at this point.
So say you have a 1080p image then you will probably get a generated image of 1200 x 1920.
I can suggest a few "cheats", although this is only good for non academic purposes :
If you have Photoshop installed, go to Nik software and download the Photoshop addons. One of them called the Image Sharpening tools (Output sharpening) which allows you to sharpen the image which has been upscaled. You can also modify the "structure" parameter, which can improve the quality.
from neural-style-transfer.
I had run this implementation: https://colab.research.google.com/drive/1rDTE8Kssqdgc-evxO2JSkAE1YLIFRjwS (it is L-BFGS).
For 960x1280 like no prob. Same size gives out of memory error here.
from neural-style-transfer.
Related Issues (20)
- [Question] Content mask format HOT 5
- how to run the script on multiples GPU?
- ImportError: cannot import name 'imread' HOT 5
- Google colab neural style transfer HOT 2
- error in MRFNetwork.py HOT 1
- could we apply fast-style-transfer to image deformation? HOT 2
- Update documentation to reflect that tensorflow works on Windows now
- Replace tf.gradients with tf.GradientTape : RuntimeError HOT 2
- Bug using preserve color option HOT 3
- ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int32: 'Tensor("strided_slice_8:0", shape=(), dtype=int32)' HOT 1
- script helper
- script helper
- Saving model
- RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead. HOT 5
- convert_all_kernels_in_model removed from tf2 HOT 1
- RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead. HOT 2
- neural doodle
- broken and unusable HOT 1
- Tensorflow 1 is unsupported in Colab
- Hello, I'm sorry to bother you. I need help
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neural-style-transfer.