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

Handle Transparency in evaluate.py #71

Closed
jonobr1 opened this issue Apr 18, 2017 · 3 comments
Closed

Handle Transparency in evaluate.py #71

jonobr1 opened this issue Apr 18, 2017 · 3 comments

Comments

@jonobr1
Copy link

jonobr1 commented Apr 18, 2017

I've got fast-style-transfer running and it's so awesome to see the results! I've made my own checkpoint and love tweaking the values. I was wondering, is there a way to handle transparent PNGs or GIFs so that when alpha = 0 the style transfer isn't applied?

@jonobr1
Copy link
Author

jonobr1 commented Apr 18, 2017

So I noticed that you can change the format handled for the incoming images here: https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py#L16 which I changed from RGB to RGBA based on the SciPy documentation. I get a new error saying Assign requires shapes of both tensors to match. My hunch is that I need to generate a checkpoint that's also RGBA format. Will continue to poke around and post updates here.

@lengstrom
Copy link
Owner

I think your goal is pretty underspecified right now. I'm not sure what "when alpha = 0 the style transfer isn't applied" means.

@onyedikilo
Copy link

He probably means that he has an RGBA image with an alpha channel as the transparency and he wants the style to apply only to the pixels where there is no transparency (opaque). Like an alpha mask.

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