Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/domain-adaptation/plot_otda_color_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
r = np.random.RandomState(42)


def im2mat(I):
def im2mat(img):
"""Converts an image to matrix (one pixel per line)"""
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
return img.reshape((img.shape[0] * img.shape[1], img.shape[2]))


def mat2im(X, shape):
"""Converts back a matrix to an image"""
return X.reshape(shape)


def minmax(I):
return np.clip(I, 0, 1)
def minmax(img):
return np.clip(img, 0, 1)


##############################################################################
Expand Down
8 changes: 4 additions & 4 deletions examples/domain-adaptation/plot_otda_linear_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@
# ---------------


def im2mat(I):
def im2mat(img):
"""Converts and image to matrix (one pixel per line)"""
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
return img.reshape((img.shape[0] * img.shape[1], img.shape[2]))


def mat2im(X, shape):
"""Converts back a matrix to an image"""
return X.reshape(shape)


def minmax(I):
return np.clip(I, 0, 1)
def minmax(img):
return np.clip(img, 0, 1)


# Loading images
Expand Down
8 changes: 4 additions & 4 deletions examples/domain-adaptation/plot_otda_mapping_colors_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
r = np.random.RandomState(42)


def im2mat(I):
def im2mat(img):
"""Converts and image to matrix (one pixel per line)"""
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
return img.reshape((img.shape[0] * img.shape[1], img.shape[2]))


def mat2im(X, shape):
"""Converts back a matrix to an image"""
return X.reshape(shape)


def minmax(I):
return np.clip(I, 0, 1)
def minmax(img):
return np.clip(img, 0, 1)


##############################################################################
Expand Down
4 changes: 2 additions & 2 deletions examples/gromov/plot_gromov_barycenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def smacof_mds(C, dim, max_iter=3000, eps=1e-9):
# The four distributions are constructed from 4 simple images


def im2mat(I):
def im2mat(img):
"""Converts and image to matrix (one pixel per line)"""
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
return img.reshape((img.shape[0] * img.shape[1], img.shape[2]))


square = pl.imread('../../data/square.png').astype(np.float64)[:, :, 2]
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@
license='MIT',
scripts=[],
data_files=[],
requires=["numpy", "scipy", "cython"],
setup_requires=["numpy>=1.16", "scipy>=1.0", "cython>=0.23"],
install_requires=["numpy>=1.16", "scipy>=1.0", "cython>=0.23"],
setup_requires=["numpy>=1.16", "cython>=0.23"],
install_requires=["numpy>=1.16", "scipy>=1.0"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down