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

Color transfer #29

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open

Color transfer #29

wants to merge 59 commits into from

Conversation

MichielStock
Copy link
Owner

No description provided.

@MichielStock
Copy link
Owner Author

Starting to look good.

  • add your name and a title to the notebook
  • maybe there is a more elegant way of downloading the images? You might check some of the pluto docs. Would be nice if there are buttons I can select my own images.
  • best to split your functions into different cells
  • you can represent every pixel as the RGB + location and use k-means clustering to get prototype pixels. The obtained centres can be mapped and used for prediction again. This way you don't need downscaling.
  • When making your own types (Cluster) adding type annotation greatly improves performance
  • you might tidy up the organization of your functions.

Bottom line: make sure you don't have to do OT on all the pixels. Make this part of your preprocessing.

This was my attempt (a long time ago): https://github.com/MichielStock/Teaching/blob/master/Optimal_transport/color_transfer.py

Below is the advice I got from Mathieu Blondel

Pasted image 20210505131036

Good luck!

@juhlee
Copy link

juhlee commented Jan 5, 2022

Thank you for the detailed comment!

@juhlee juhlee deleted the branch MichielStock:master January 24, 2022 14:53
@juhlee juhlee deleted the master branch January 24, 2022 14:53
@MichielStock
Copy link
Owner Author

It is shaping up to be a very impressive project. When uploading your notebook, I still have some trouble doing this right, mainly because the links to images are relative (better use hyperlinks to github). Maybe have someone else testing it that works locally fine.

image

@juhlee
Copy link

juhlee commented Jan 26, 2022

Thank you for an important comment...! I did not expect "image_load()" to not work properly.

@juhlee
Copy link

juhlee commented Jan 26, 2022

When first opening the notebook, did the two default sample images (cityscape.jpg, sunset.jpg) not load properly?

@MichielStock
Copy link
Owner Author

MichielStock commented Jan 26, 2022 via email

@juhlee
Copy link

juhlee commented Jan 28, 2022

Thank you!

  • I used "try/catch" statement to first try loading locally, then download the image if an local loading did not work.
  • I then confirmed the notebook to run fine in another colleague's (outside of STMO course) computer.

@vandeveldet
Copy link

Great notebook and very clear walkthrough. Nice to have options available and see the effect on the clustering/color transfer. Initial issues with package loading were resolved by an update by @juhlee. Feel free to add a function when taking a repetitive action. Some small typo's: Eucl_i_dian distance and function reassi_gn_ing(). It worked well when adding new figures for Patrick and Spongebob ;).
patrick

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

Successfully merging this pull request may close these issues.

3 participants