diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2016-11-02 12:25:05 +0100 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2016-11-02 12:25:05 +0100 |
commit | 3c4944cf705477c913e5feb8f2483d0fa40ed5e1 (patch) | |
tree | b6cdc9822d9ccbc44d25e72fb6376aab5630caee /examples/demo_OTDA_color_images.py | |
parent | 3f46a247b174918e24e2e448b21de21bb0037b2c (diff) |
add notebook for color transfer in images
Diffstat (limited to 'examples/demo_OTDA_color_images.py')
-rw-r--r-- | examples/demo_OTDA_color_images.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/examples/demo_OTDA_color_images.py b/examples/demo_OTDA_color_images.py index 7a08ea0..715707d 100644 --- a/examples/demo_OTDA_color_images.py +++ b/examples/demo_OTDA_color_images.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -demo of Optimal transport for domain adaptation with image color adaptation as in [6] +Demo of Optimal transport for domain adaptation with image color adaptation as in [6] [6] Ferradans, S., Papadakis, N., Peyré, G., & Aujol, J. F. (2014). Regularized discrete optimal transport. SIAM Journal on Imaging Sciences, 7(3), 1853-1882. """ @@ -51,6 +51,30 @@ idx2=np.random.randint(X2.shape[0],size=(nb,)) xs=X1[idx1,:] xt=X2[idx2,:] +#%% Plot image distributions + + +pl.figure(2,(10,5)) + +pl.subplot(1,2,1) +pl.scatter(xs[:,0],xs[:,2],c=xs) +pl.axis([0,1,0,1]) +pl.xlabel('Red') +pl.ylabel('Blue') +pl.title('Image 1') + +pl.subplot(1,2,2) +#pl.imshow(I2) +pl.scatter(xt[:,0],xt[:,2],c=xt) +pl.axis([0,1,0,1]) +pl.xlabel('Red') +pl.ylabel('Blue') +pl.title('Image 2') + +pl.show() + + + #%% domain adaptation between images # LP problem |