neural-style icon indicating copy to clipboard operation
neural-style copied to clipboard

About people face not good

Open devpuck opened this issue 8 years ago • 7 comments

When I use the original VGG-19 model,I found when face in the picture,the face in the finished picture is not good.How could I change the options to get good effect.Who can give me advise? Thanks!

devpuck avatar Feb 20 '17 09:02 devpuck

My experiments (not vary familiar with ML) showed some options for this problem

  • Try to play with style_scale and style_layers. I have python scripts that try almost all valuable combinations of these params (keep num_iterations to greatly speed up processing).
  • I have better results with Texture nets in term of less distortion. Also you can try additional params that have some forks of this repository.
  • There are some implementation of neural styling that provides masks for processing. You can use OpenCV to detect a face and apply a mask to it.

MrZoidberg avatar Feb 20 '17 09:02 MrZoidberg

I've tried style_scale,style_layers,content_weight,style_weight and other options,but the face in the finished picture is still not good. Can you tell your options? Thanks

devpuck avatar Feb 20 '17 11:02 devpuck

My last time I've used these options, but the result depends on the styling image anyway:

python run_neural_style.py -style_scale 1.2 -init image -style_image .... -content_image ~... -image_size 750 -output_path ... -content_weight 5 -style_weight 50 -save_iter 100 -num_iterations 1000 -gpu 0 -optimizer adam -tv_weight 0.001 -learning_rate 6 -seed 123 -style_layers relu1_2,relu2_2,relu3_2,relu4_2 -original_colors True -content_layers relu5_2

MrZoidberg avatar Feb 20 '17 11:02 MrZoidberg

In my opinion, you may need to find out what kind of exact style you want. You may not have to use all the initial style layers( relu1_2,relu2_2,relu3_2,relu4_2 ). I had a good result with relu2_1,relu3_1,relu4_1. So you can start with -content_weight 0 to find the style you expected. What's more, L-BFGS tends to give better results.

SilvesterHsu avatar Feb 20 '17 12:02 SilvesterHsu

How could I choose style_layers?I found when I userelu1_2,relu2_2,relu3_2,relu4_2 or relu1_2,relu2_2,relu3_2,relu4_2,the face is worse... What's the mean of style_layers?I know this is neural network layers,but how I know what layer fit me?

devpuck avatar Feb 20 '17 14:02 devpuck

I may misleaded you, but I actually got a nice result. This page may help you #363

SilvesterHsu avatar Feb 21 '17 13:02 SilvesterHsu

@devpuck You can check out my experiments in fine tuning a model to improve facial feature preservation here: https://github.com/jcjohnson/neural-style/issues/292#issuecomment-300685209

ProGamerGov avatar Jun 21 '17 19:06 ProGamerGov