Code Monkey home page Code Monkey logo

Comments (4)

cysmith avatar cysmith commented on June 3, 2024

--style_imgs s1.jpg s2.jpg --style_mask --style_mask_imgs m1.jpg m2.jpg

You need a mask for each style image though.

from neural-style-tf.

njordsir2 avatar njordsir2 commented on June 3, 2024

To recreate the last segmentation example as given in the Readme, I executed the following, which follows the pattern you mentioned above.

python neural_style.py --content_img 02270.jpg --content_img_dir examples/segmentation --style_imgs okeffe_red_canna.jpg okeffe_iris.jpg --style_imgs_dir examples/segmentation --style_mask_imgs 02270_mask_face.jpg 02270_mask_face_inv.jpg --verbose --model_weights "/xx/imagenet-vgg-verydeep-19.mat" --optimizer adam --max_iterations 1000 --print_iterations 10

(The png images were converted to jpg prior to use)

This is the associated metadata :

image_name: result
content: 02270.jpg
styles[0]: 1.0 * okeffe_red_canna.jpg
style_masks[0]: 02270_mask_face.jpg
style_masks[1]: 02270_mask_face_inv.jpg
init_type: content
content_weight: 5.0
style_weight: 1000.0
tv_weight: 0.001
content_layers: ['conv4_2']
style_layers: ['relu1_1', 'relu2_1', 'relu3_1', 'relu4_1', 'relu5_1']
optimizer_type: adam
max_iterations: 1000
max_image_size: 512

I am unable to upload result here. Only one style image is being used for stylization.

from neural-style-tf.

cysmith avatar cysmith commented on June 3, 2024

Hi njordsir,

I think you need to add the flag --style_mask. I should remove that and just check if the length of the style mask images list is >0.

Cam

from neural-style-tf.

njordsir2 avatar njordsir2 commented on June 3, 2024

Adding the --style_mask flag and setting the blending weights as --style_imgs_weights 0.5 0.5 generated the desired result.

Maybe the blending weights could be equally distributed among all style images instead of the current default of 1.0, unless otherwise specified.

Thanks for the very well-written code and your help.

from neural-style-tf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.