jiupinjia / stylized-neural-painting

Official Pytorch implementation of the preprint paper "Stylized Neural Painting", in CVPR 2021.
https://jiupinjia.github.io/neuralpainter/
Creative Commons Zero v1.0 Universal
1.56k stars 262 forks source link

Can i have smaller strokes for hi res images? #24

Open hadaev8 opened 3 years ago

jiupinjia commented 3 years ago

Hi @hadaev8, to generate smaller strokes, you can try lightweight renderers, set more strokes (e.g. --max_m_strokes 1000), and more divides (e.g. --max_divide 8) as long as your GPU memory can support them. You can try the following and please let me know if it helps: python demo_prog.py --img_path ./test_images/apple.jpg --canvas_color 'white' --max_m_strokes 1000 --max_divide 8 --renderer oilpaintbrush --renderer_checkpoint_dir checkpoints_G_oilpaintbrush_light --net_G zou-fusion-net-light

hadaev8 commented 3 years ago

@jiupinjia Have you any numbers? For example in colab demo image size 512x512 max_m_strokes 500 max_divide 8 For 1920x1080 does it mean I should have these values multiplied with factor 4?

jiupinjia commented 3 years ago

@hadaev8, for a 1920x1080 image, you can try --max_m_strokes 2000 and --max_divide 8, and see if your GPU can support them.

hadaev8 commented 3 years ago

@jiupinjia Should you advise why I can't have more than max_divide = 12 Is it intended?

jiupinjia commented 3 years ago

You can of course try a max_divide number equal or larger than 12, as long as your GPU memory can support them.

hadaev8 commented 3 years ago

@jiupinjia How model choose stroke size? What max_divide param mean?

jiupinjia commented 3 years ago

@hadaev8 The parameter max_divide controls the resolution of each image block. For example, if you set max_divide=5, then the image is first divided into 5x5=25 blocks and then the painting strokes will be generated for each of them separately.

poioef commented 3 years ago

请问light是有什么作用呢?

jiupinjia commented 3 years ago

Hi @poioef, "light" is for lightweight rendering. If you have limited GPU memory or want a faster rendering speed, you can try those. Please see README for more details. Thanks!

poioef commented 3 years ago

Hi @poioef, "light" is for lightweight rendering. If you have limited GPU memory or want a faster rendering speed, you can try those. Please see README for more details. Thanks!

Thanks, but I've already seen README. I want to know if light will make the result worse.I am sorry for trouble you.

jiupinjia commented 3 years ago

Hi @poioef, with lightweight rendering, the result will become slightly worse but it will also be much faster. Thanks!