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

Has ImagesLoss ever been finished? Or is it still a WIP? #65

Open
kaselby opened this issue Jun 26, 2022 · 4 comments
Open

Has ImagesLoss ever been finished? Or is it still a WIP? #65

kaselby opened this issue Jun 26, 2022 · 4 comments

Comments

@kaselby
Copy link

kaselby commented Jun 26, 2022

In previous issues I saw mention of an implementation of this focused on images or segmentation maps. This would be extremely helpful for a project I am currently working on, but I don't see ImagesLoss in the code anywhere. The previous comments said it might be finished/added by early 2020 - am I just missing it, or was this never finished?

If it is still unfinished, would you be able to post the unfinished implementation so I can try to work with it? However unfinished it is, I'm sure it will certainly be better than whatever I try to implement from scratch myself.

@jeanfeydy
Copy link
Owner

Hi @krylea,

Thanks for your interest in the library!
The proper integration of ImagesLoss is still WIP: unfortunately, I had to prioritize other works during the Covid years to secure a permanent academic job, which delayed the development for several years... But I am back to active coding now (in the ot_api branch) and will finally release all these features this summer.
Until then, you may be interested by the geomloss/sinkhorn_images.py file that provides the "unofficial" implementation that you are looking for :-)

Best regards,
And good luck for your project,
Jean

@pietz
Copy link

pietz commented Jun 28, 2022

When you say "images" you're referring to distributions in pixel space such as segmentation masks or heatmaps, correct? Because that's also what I'm looking for at the moment.

Thanks for your hard work!

@jeanfeydy
Copy link
Owner

Hi @pietz,

Yes indeed: density maps on 1D/2D/3D grids. I agree that this is a misleading terminology, since manipulating density is quite different to manipulating intensities (= what we tend to think about when we talk about natural images). From a mathematical perspective, the difference is in the impact of dilations/contractions on the domain: density values get scaled by the inverse of the local scaling factor (the Jacobian) to keep a constant sum on the domain, while intensities stay constant locally.

Optimal transport is all about densities - and so is GeomLoss for the time being. Extending these tools to intensities would be very useful, but I am not aware of a fully satisfying and tractable solution in the literature as of 2022.

Best regards,
Jean

@Perian-Yan
Copy link

Hi,
thank you for your great work!

If ImageLoss is still WIP, is there a workaround to use SampleLoss for density maps?

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

4 participants