Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use several style images #14

Open
Daniel63656 opened this issue Oct 25, 2021 · 2 comments
Open

Use several style images #14

Daniel63656 opened this issue Oct 25, 2021 · 2 comments

Comments

@Daniel63656
Copy link

Hello
can someone tell me the syntax if i want to hand over a list of style images?

@terekita
Copy link

terekita commented Oct 26, 2021

I don't know enough about python to fully explain this, but after finding myself unable to the use the 'content' and 'styles' arguments the way I expected, I edited lines 155 and 156 in cli.py to be the following:
p.add_argument('-content', type=str, help='the content image') p.add_argument('-styles', type=str, nargs='+', metavar='style', help='the style images')
(added the dash in front of both content and style).

After that, you can do command like:
cw = 0.015 * 1 #this is the content weight—make it a larger number to emphasize the content
!style_transfer -content 'file1.jpg' -styles 'style1.jpg' -cw $cw -s 512

Then, if you want multiple style images, you can do

!style_transfer -content afile1.jpg -styles style1.jpg style2.jpg -sw 0.5 3.75 -cw $cw -s 512

The two numbers after -sw are the weights for the two files that you specify after -styles. If you want more than two, then simply list more than 2 files after -styles, and supply the corresponding number of weights after -sw.

Apologies for any jankiness, but I hope that at least helps you get closer to what you are looking for..

@meefs
Copy link

meefs commented Nov 8, 2021

@Daniel63656 ,

The program uses the first file supplied as content and the rest as styles. Using the example below I have been able to run multiple styles:

./style_transfer /path/to/content.jpg /path/to/style1.jpg /path/to/style2.jpg /path/to/style3.jpg ...

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants