cysmith / neural-style-tf

TensorFlow (Python API) implementation of Neural Style
GNU General Public License v3.0
3.11k stars 828 forks source link

I can't find how to use the weight settings? #118

Open simondice opened 3 years ago

simondice commented 3 years ago

Hi,

I'm searching for a way to increase style weight so it looks closer to the style than the source image. I can't find the range of the settings, nor the one I should use like in the example "style tradeoff".

Any help?

nickyvdz-art commented 3 years ago

Hi,

Arguments

--content_img: Filename of the content image. Example: lion.jpg
--content_img_dir: Relative or absolute directory path to the content image. Default: ./image_input
--style_imgs: Filenames of the style images. To use multiple style images, pass a space-separated list. Example: --style_imgs starry-night.jpg
--style_imgs_weights: The blending weights for each style image. Default: 1.0 (assumes only 1 style image)
--style_imgs_dir: Relative or absolute directory path to the style images. Default: ./styles
--init_img_type: Image used to initialize the network. Choices: content, random, style. Default: content
--max_size: Maximum width or height of the input images. Default: 512
--content_weight: Weight for the content loss function. Default: 5e0
--style_weight: Weight for the style loss function. Default: 1e4
--tv_weight: Weight for the total variational loss function. Default: 1e-3
--temporal_weight: Weight for the temporal loss function. Default: 2e2

etc.

its at the end of the README - scroll towards bottom main page

apologies if ive misunderstood

simondice commented 3 years ago

"apologies if ive misunderstood" yeah kinda

--content_weight: Weight for the content loss function. Default: 5e0 --style_weight: Weight for the style loss function. Default: 1e4 --tv_weight: Weight for the total variational loss function. Default: 1e-3 --temporal_weight: Weight for the temporal loss function. Default: 2e2

I don't get it sorry, so default is 5, 10000, but how does it work? I'm not familiar with neutal styles equations and I'm bad at maths. --style_weight 10000 --style_weight 20000? or 1000? or 10000000? is there a range in which it evolves? I'm looking to generate outputs that doesn't look like the content_img but more like the style, I had pretty funny result using the online generator with "weight 90%", I'm trying to reproduce with this code. any advices would help here is an example, from a girl's picture to this using a 90% style weight (here https://deepdreamgenerator.com/) https://i.imgur.com/JNnBIlH.png I'm messing around with layers but same, default is 0.2 0.2 0.2 0.2 0.2, how does it work? Sorry for being such a noob :)

Have a good day

nickyvdz-art commented 3 years ago

maybe consider this one instead; will be more similar experience to deepdreamgen.

https://github.com/anishathalye/neural-style

On Mon, Apr 5, 2021, at 03:14, simondice wrote:

"apologies if ive misunderstood" yeah kinda

--content_weight: Weight for the content loss function. Default: 5e0 --style_weight: Weight for the style loss function. Default: 1e4 --tv_weight: Weight for the total variational loss function. Default: 1e-3 --temporal_weight: Weight for the temporal loss function. Default: 2e2

I don't get it sorry, so default is 5, 10000, but how does it work? I'm not familiar with neutal styles equations and I'm bad at maths. --style_weight 10000 --style_weight 20000? or 1000? or 10000000? is there a range in which it evolves? I'm looking to generate outputs that doesn't look like the content_img but more like the style, I had pretty funny result using the online generator with "weight 90%", I'm trying to reproduce with this code. any advices would help here is an example, from a girl's picture to this using a 90% style weight (here https://deepdreamgenerator.com/) https://i.imgur.com/JNnBIlH.png I'm messing around with layers but same, default is 0.2 0.2 0.2 0.2 0.2, how does it work? Sorry for being such a noob :)

Have a good day

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cysmith/neural-style-tf/issues/118#issuecomment-813067315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQLUPAFCWLZN5ZN2NZRZ5S3THCM75ANCNFSM42LDWPRQ.

simondice commented 3 years ago

Ok will have a try thanks.

nickyvdz-art commented 3 years ago

thats maybe a more 'painless' way out;

what i do is, i edit the neural_style.py and tweak the values in there, instead of 'commands'

then i just bash stylize_image.sh

as far as what all the little bells and whistles do - welcome to the casino

On Mon, Apr 5, 2021, at 05:50, simondice wrote:

Ok will have a try thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cysmith/neural-style-tf/issues/118#issuecomment-813090008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQLUPADVC7LLFUJNEAPJBBTTHC7JJANCNFSM42LDWPRQ.