Skip to content

Commit c263149

Browse files
authored
Merge pull request #73 from aboisbunon/color_tranfer_bug_correction
Corrected the Sinkhorn prediction images
2 parents d4847a8 + f9995cf commit c263149

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/plot_otda_color_images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
OT for image color adaptation
55
=============================
66
7-
This example presents a way of transferring colors between two image
7+
This example presents a way of transferring colors between two images
88
with Optimal Transport as introduced in [6]
99
1010
[6] Ferradans, S., Papadakis, N., Peyre, G., & Aujol, J. F. (2014).
@@ -27,7 +27,7 @@
2727

2828

2929
def im2mat(I):
30-
"""Converts and image to matrix (one pixel per line)"""
30+
"""Converts an image to matrix (one pixel per line)"""
3131
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
3232

3333

@@ -115,8 +115,8 @@ def minmax(I):
115115
transp_Xs_emd = ot_emd.transform(Xs=X1)
116116
transp_Xt_emd = ot_emd.inverse_transform(Xt=X2)
117117

118-
transp_Xs_sinkhorn = ot_emd.transform(Xs=X1)
119-
transp_Xt_sinkhorn = ot_emd.inverse_transform(Xt=X2)
118+
transp_Xs_sinkhorn = ot_sinkhorn.transform(Xs=X1)
119+
transp_Xt_sinkhorn = ot_sinkhorn.inverse_transform(Xt=X2)
120120

121121
I1t = minmax(mat2im(transp_Xs_emd, I1.shape))
122122
I2t = minmax(mat2im(transp_Xt_emd, I2.shape))

0 commit comments

Comments
 (0)