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

Performance of colornet #17

Closed
TanmayKhot opened this issue Apr 24, 2021 · 1 comment
Closed

Performance of colornet #17

TanmayKhot opened this issue Apr 24, 2021 · 1 comment
Labels
question Further information is requested

Comments

@TanmayKhot
Copy link

TanmayKhot commented Apr 24, 2021

Hello, I noticed that in the stefann.py file, you have provided three methods for style transfer, transfer_color_pal, transfer_color_max, and the colornet implementation. I uncommented the lines from 480-487 in the stefann.py file to use the colornet model. When I tested the application on images from 'sample_images' folder using the colornet method with the provided pretrained weights, it did not work very well and produced blurry and inconsistent results. The results of colornet did not match the results given in the 'editing_examples' folder.

Given Result (Left - Original Image, Right - stefann generated image)
08
Output using colornet
08_colornet

There are many more cases where the colornet model is not performing as expected. Could you please help me with this?

@prasunroy prasunroy added the question Further information is requested label Apr 25, 2021
@prasunroy
Copy link
Owner

Your observation is correct. This happens due to inadequate domain adaptation. Colornet is trained with only 800 synthetic color filters which is merely ~0.005% of all ~16.8 million possibilities. While the results on synthetic validation set and test set are quite appealing, it struggles to generalize on real scene texts in many occasions. This limitation is found to be more prominent for solid colors than gradient colors. For most of the scene text examples, the color distribution over the character is homogeneous (solid). Due to this reason, the demo application uses the color with maximum occurrence.

Here is a basic comparison among different color transfer schemes on a synthetic image with gradient colors:

Original image:
original_image

Edited images:
color_transfer

Note that Colornet can reproduce color gradients but suffers from distortion and bleeding near edges. transfer_color_pal produces sharper edges but suffers from dirty patches created from direct interpolation. transfer_color_max produces sharper edges and cleaner images but completely ignores gradients. There is a trade-off for selecting any one scheme over another.

For most of the real scene text images, we found transfer_color_max to be most appropriate.

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

No branches or pull requests

2 participants