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

EyepadAlign for aligning face images across different datasets #466

Merged
merged 46 commits into from
Dec 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5500f6a
Adding a new module for aligning face images across different datasets
vmirly Nov 14, 2018
76b9d69
added new utility functions for reading/listing images in a directory
vmirly Nov 17, 2018
66c40ed
upd utility function to raise exception if file not found
vmirly Nov 17, 2018
b56a5b8
first version of EyepadAlign created
vmirly Nov 17, 2018
e33c4a7
added eyepad_align to __init__.py
vmirly Nov 17, 2018
0ebf7c6
requirement skimage added to ci/travis
vmirly Nov 17, 2018
09aa5eb
docs for the EyepadAlign class
vmirly Nov 17, 2018
4d726d3
upd EyepadAlign and appveyor installation
vmirly Nov 17, 2018
318156d
cache pip files
rasbt Nov 17, 2018
a52a172
add better caching and env specs
rasbt Nov 17, 2018
bf31bfc
add osx to build matrix
rasbt Nov 17, 2018
1c181bf
try python 3 with osx
rasbt Nov 17, 2018
e540ce3
fix osx tests
rasbt Nov 17, 2018
476de60
fix osx tests
rasbt Nov 18, 2018
5d14a69
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
eb336aa
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
7d6f175
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
225a032
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
3258731
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
b3a67b8
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
6b9965f
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
223deec
workaround since for some reason travis does not support python on osx
rasbt Nov 18, 2018
d0e5913
added nosetest for EyepadAlign
vmirly Nov 20, 2018
2b93d27
fix unit test for windows
rasbt Nov 20, 2018
5a9f7ef
check if windows returns identical jpg
rasbt Nov 20, 2018
9580d50
check if windows returns identical jpg
rasbt Nov 20, 2018
4d78a10
tolerance for imagio on windows
rasbt Nov 20, 2018
956baec
code fixes and cleanup
rasbt Nov 22, 2018
7b6b40c
Merge branch 'master' into vm-eyepad
rasbt Dec 5, 2018
be5617e
Added documnetation to EyepadAlign
vmirly Dec 8, 2018
d5c9473
Merge branch 'vm-eyepad' of github.com:vmirly/mlxtend into vm-eyepad
vmirly Dec 8, 2018
956dc66
refactoring one
rasbt Dec 8, 2018
075756c
Fixed the nosetest issue
vmirly Dec 8, 2018
3197b12
uncommented the no-face-check
vmirly Dec 8, 2018
d06134e
Fix the PEP8 issues
vmirly Dec 8, 2018
243faac
Fix the string-formatting error in fit_directory() function
vmirly Dec 8, 2018
079774f
fixed eyepad tests, checking no-faces -> return None
vmirly Dec 9, 2018
6c03324
updated docs and added new examples for EyepadAlign usage
vmirly Dec 9, 2018
850ea31
Merge branch 'master' into vm-eyepad
rasbt Dec 9, 2018
2f56f46
refinement
rasbt Dec 9, 2018
5b51b7f
fix travis
rasbt Dec 9, 2018
594e820
fix fit check
rasbt Dec 9, 2018
5b70d0f
attempt to fix unit tests
rasbt Dec 9, 2018
7422c05
update travis
rasbt Dec 9, 2018
9b77efa
change macOS python to python 3.6
rasbt Dec 9, 2018
ac80d96
update docs
rasbt Dec 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ install:
- pip install nose-exclude
- pip install dlib
- pip install imageio
- pip install scikit-image

test_script:
- nosetests -s -v --exclude-dir=mlxtend/plotting
Expand Down
40 changes: 34 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
sudo: required
language: python
language: generic

cache:
apt: true
directories:
- $HOME/.cache/pip
- $HOME/.ccache

dist: trusty

env:
global:
# Directory where tests are run from
- TEST_DIR=/tmp/sklearn
- OMP_NUM_THREADS=4
- OPENBLAS_NUM_THREADS=4

matrix:
include:
- python: 3.6
- os: linux
sudo: required
python: 3.6
env: LATEST="false" IMAGE="true" COVERAGE="false" NUMPY_VERSION="1.14.6" SCIPY_VERSION="1.1.0" SKLEARN_VERSION="0.20.1" PANDAS_VERSION="0.23.4" MINICONDA_PYTHON_VERSION=3.7
- python: 3.6 # python 3.7
- os: linux
python: 3.6
env: LATEST="true" IMAGE="true" COVERAGE="true" NOTEBOOKS="true" MINICONDA_PYTHON_VERSION=3.7
- python: 3.6 # python 3.7
- os: linux
sudo: required
python: 3.6
env: LATEST="true" IMAGE="false" COVERAGE="false" NOTEBOOKS="false" MINICONDA_PYTHON_VERSION=3.7


before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi

install:
- sudo apt-get update
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get update; fi
- source ci/.travis_install.sh

script:
- bash ci/.travis_test.sh

after_success:
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi

notifications:
email:
recipients:
Expand Down
18 changes: 15 additions & 3 deletions ci/.travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@

set -e

if [ "${TRAVIS_PYTHON_VERSION}" == "2.7" ]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
if [ "${TRAVIS_PYTHON_VERSION}" == "2.7" ]; then

wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
fi
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
if [ "${TRAVIS_PYTHON_VERSION}" == "2.7" ]; then

wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
fi
fi


bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
Expand All @@ -32,6 +43,7 @@ conda install jupyter
if [ "${IMAGE}" = "true" ]; then
pip install dlib
pip install imageio
pip install scikit-image
fi

if [ "${COVERAGE}" = "true" ]; then
Expand Down
31 changes: 19 additions & 12 deletions ci/.travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@
set -e


if [[ "$COVERAGE" == "true" ]]; then
if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then

if [[ "$IMAGE" == "true" ]]; then
nosetests -s -v --with-coverage
else
nosetests -s -v --with-coverage --exclude-dir=mlxtend/image
fi

if [[ "$COVERAGE" == "true" ]]; then

if [[ "$IMAGE" == "true" ]]; then
nosetests -s -v --with-coverage
else
nosetests -s -v --with-coverage --exclude-dir=mlxtend/image
fi

else
if [[ "$IMAGE" == "true" ]]; then
nosetests -s -v
else
nosetests -s -v --exclude-dir=mlxtend/image
fi
fi

else
if [[ "$IMAGE" == "true" ]]; then
nosetests -s -v
else
nosetests -s -v --exclude-dir=mlxtend/image
fi
nosetests -s -v --exclude-dir=mlxtend/plotting
fi


if [[ "$NOTEBOOKS" == "true" ]]; then
cd docs
Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ nav:
- user_guide/general_concepts/regularization-linear.md
- image:
- user_guide/image/extract_face_landmarks.md
- user_guide/image/eyepad_align.md
- math:
- user_guide/math/num_combinations.md
- user_guide/math/num_permutations.md
Expand Down
2 changes: 2 additions & 0 deletions docs/sources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ The CHANGELOG for the current development version is available at

##### New Features

- Adds a new transformer class to `mlxtend.image`, `EyepadAlign`, that aligns face images based on the location of the eyes. ([#466](https://github.com/rasbt/mlxtend/pull/466) by [Vahid Mirjalili](https://github.com/vmirly))
- Adds a new function, `mlxtend.evaluate.bias_variance_decomp` that decomposes the loss of a regressor or classifier into bias and variance terms. ([#470](https://github.com/rasbt/mlxtend/pull/470))
- Adds a `whitening` parameter to `PrincipalComponentAnalysis`, to optionally whiten the transformed data such that the features have unit variance. ([#475](https://github.com/rasbt/mlxtend/pull/475))

##### Changes

- Changed the default solver in `PrincipalComponentAnalysis` to `'svd'` instead of `'eigen'` to improve numerical stability. ([#474](https://github.com/rasbt/mlxtend/pull/474))
- The `mlxtend.image.extract_face_landmarks` now returns `None` if no facial landmarks were detected instead of an array of all zeros. ([#466](https://github.com/rasbt/mlxtend/pull/466))


##### Bug Fixes
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/sources/user_guide/image/extract_face_landmarks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.5"
"version": "3.6.5"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": true,
Expand Down
764 changes: 764 additions & 0 deletions docs/sources/user_guide/image/eyepad_align.ipynb

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions mlxtend/externals/pyprind/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Sebastian Raschka 2014-2017
Python Progress Indicator Utility

Author: Sebastian Raschka <sebastianraschka.com>
License: BSD 3 clause

Contributors: https://github.com/rasbt/pyprind/graphs/contributors
Code Repository: https://github.com/rasbt/pyprind
PyPI: https://pypi.python.org/pypi/PyPrind
"""


from .progbar import ProgBar
from .progpercent import ProgPercent
from .generator_factory import prog_percent
from .generator_factory import prog_bar


__version__ = '2.11.2'
24 changes: 24 additions & 0 deletions mlxtend/externals/pyprind/generator_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PyPrind
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# Contributors: https://github.com/rasbt/pyprind/graphs/contributors
# License: BSD 3 clause
# Code Repository: https://github.com/rasbt/pyprind
# PyPI: https://pypi.python.org/pypi/PyPrind

from .progbar import ProgBar
from .progpercent import ProgPercent


def generator_factory(mother_class):
def generator_progress(iteritem, iterations=None, *args, **kw):
if iterations is None:
iterations = len(iteritem)
assert iterations
mbar = mother_class(iterations, *args, **kw)
for item in iteritem:
yield item
mbar.update()
return generator_progress

prog_percent = generator_factory(ProgPercent)
prog_bar = generator_factory(ProgBar)