Skip to content

Commit a712ece

Browse files
committed
Update build
1 parent 20d50f3 commit a712ece

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Config file for automatic testing at travis-ci.org
2-
# This file will be regenerated if you run travis_pypi_setup.py
3-
41
language: python
52
python:
63
- "2.7"
@@ -9,8 +6,8 @@ python:
96
- "3.5"
107
- "3.6"
118

12-
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
9+
before_install: pip install git+https://github.com/ageitgey/face_recognition_models
10+
1311
install: pip install -r requirements.txt --use-mirrors
1412

15-
# command to run tests, e.g. python setup.py test
1613
script: make test

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,19 @@ results = face_recognition.compare_faces([biden_encoding], unknown_encoding)
6666
Python 3 is fully supported. Python 2 should also work. Only macOS and
6767
Linux are tested. I have no idea if this will work on Windows.
6868

69-
You can install this module from pypi using `pip3` (or `pip2` for Python 2):
69+
1. First, install the required machine learning models using `pip3` (or `pip2` for Python 2):
7070

7171
```bash
72-
$ pip3 install face_recognition
72+
pip3 install git+https://github.com/ageitgey/face_recognition_models
7373
```
7474

75-
It's very likely that you will run into problems when pip tries to compile
75+
2. Then you can install this module from pypi using `pip3` (or `pip2` for Python 2):
76+
77+
```bash
78+
pip3 install face_recognition
79+
```
80+
81+
NOTE: It's very likely that you will run into problems when pip tries to compile
7682
the `dlib` dependency. If that happens, check out this guide to installing
7783
dlib from source instead to fix the error:
7884

face_recognition/api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
import scipy.misc
44
import dlib
55
import numpy as np
6-
import face_recognition_models
6+
7+
try:
8+
import face_recognition_models
9+
except:
10+
print("Please install `face_recognition_models` with this command before using `face_recognition`:")
11+
print()
12+
print("pip install git+https://github.com/ageitgey/face_recognition_models")
13+
quit()
714

815
predictor_model = face_recognition_models.pose_predictor_model_location()
916
pose_predictor = dlib.shape_predictor(predictor_model)

0 commit comments

Comments
 (0)