Commit Graph

12 Commits

Author SHA1 Message Date
Matias De lellis
526fb725ce Add native vector_lenght() function which calculates the euclidean distance 80%
faster. See https://github.com/matiasdelellis/pdlib/pull/2.

Increase the version to 1.0.2 since this is a required function for our
application and we must control it.

Add more compilation info in php-info(), and print a final message with the
build options when configure.

Fix that when dlib is not installed, the configuration returns that it cannot
find pkgconfig. See https://github.com/matiasdelellis/facerecognition/issues/261

Also implement the test on travis. See for example:
(https://travis-ci.com/github/matiasdelellis/pdlib/builds/161854044)
2020-07-07 19:11:56 -03:00
goodspb
c7d57a7a1b
Merge pull request #29 from remicollet/issue-build
Fix build and PHP 8 compat.
2020-07-05 22:52:46 +08:00
Remi Collet
d36a2de544 drop confirm_pdlib_compiled function
This is a generated function from example skeleton
only for documentation, no real value.

Adn it is broken on PHP 8 and arginfo is missing
2020-06-22 15:11:38 +02:00
Remi Collet
40a2bd60e4 cleanup TSRMLS_C macro
- only used on PHP 5 (not supported by this ext.)
- not needed on PHP 7
- removed from PHP 8
2020-06-22 15:01:30 +02:00
Remi Collet
8f424195e0 fix unused variables 2020-06-22 12:47:43 +02:00
Remi Collet
b70ff4eb17 display extension and library version in phpinfo 2020-06-22 11:20:55 +02:00
Branko Kokanovic
1e830a3285 Face recognition
This change adds support to retrieve 128D face descriptor for a given
landmark. Since now we have full pipeline, README.md has "general usage"
section and integration test is added. Also, return from
FaceLandmarkDetection is changed, so it can be given to FaceRecognition
without changes. All obtained values are crosschecked to match with values
from python versions (however, if num_jitters is > 1 in FaceRecognition,
values don't match between PHP and Python, I suspect it is related to usage
of dlib::rand, but still investigating)..
2018-08-29 00:31:57 +02:00
Branko Kokanovic
1a402fc63c Landmark detection (custom model and class-based)
This change extends existing landmark detection in new ways:
1. Existing logic is hiding HOG model (frontal_face_detector)
underneath and user cannot use other models (CNN model, for example).
2. Bounding box is exposed as additional argument, and user
can define custom bounding box (which is needed, if image used to detect
faces is changed (for example scaled), and we want to crop only face
from original image to feed into shape predictor).
3. This approach is class-based, so no need for multiple loadings of
shape predictor model (only once, in ctor)
2018-08-27 20:46:47 +02:00
Branko Kokanovic
3f60326661 Support for raw chinese_whispers
This commit introduces chinese_whispers method without any "helpers" on
PHP side. Users needs to take care of everything (building edges from
128D face chip vector, for example), but this is exposed for people
that need low-level call and want to calculate distances and build edges
in PHP directly.
2018-08-07 00:04:05 +02:00
Branko Kokanovic
f8cc0e48d3 Adding support for cnn face detector
CNN face detector (deep learning face detection) is modeled as
PHP class. Currently, it only has constructor (which loads a model)
and detect() method. I tried to make it resamble to Python implementation.
Similar to Python, also added support for upsampling. Returned value
is array with numbers as keys where number of keys is equal to number
of found faced. Each element is associative array that has "top", "left",
"right", "bottom" and "detection_confidence" keys.

All errors are propagated using exceptions.

Added two new error tests. I didn't want to rely on presence of model,
so tests are not having great coverage. If we are OK to download models
in tests, it would allow us to have far better coverage.

What is missing:
* Testing with models (should we test that?)
* detect_mult method (similar to what Python have; however, I consider
  that this should not block pushing this change)
2018-07-16 22:34:55 +02:00
goodspb
b8f1837335 feat: add face_landmark_detection 2018-05-24 00:56:50 +08:00
goodspb
5539b5bff8 first commit 2018-05-21 01:23:19 +08:00