Commit Graph

476 Commits

Author SHA1 Message Date
Davis King
1a3f8d5bf3 Added center() and more overloads of centered_rect() to the Python API. 2018-05-26 22:53:30 -04:00
Davis King
8516442aee Added extract_image_chip() and extract_image_chips() to the Python API. 2018-05-26 22:38:16 -04:00
Davis King
2ed128e2b4 Made dlib.range a little more like the python range. 2018-05-26 17:35:35 -04:00
Davis King
d2fa9e85e1 Cleaned up code and fixed point and dpoint addition actually doing subtraction. 2018-05-26 16:59:25 -04:00
Davis King
57e4fd207e Added a .add_overlay_circle() to dlib.image_window. 2018-05-25 19:17:03 -04:00
Davis King
91e64dfb17 Added min_barrier_distance() to the Python API. 2018-05-25 19:14:53 -04:00
Davis King
37d13ae88e Fixed some python functions not taking as wide a range of images as they did in
previous dlib versions.
2018-05-25 19:03:00 -04:00
Davis King
bd2e0bc306 Made skeleton(), in the python API, return the given image so
you can chain calls easily.
2018-05-24 21:06:20 -04:00
Davis King
c1f5f32b2a Renamed convert_rgb_to_grayscale() to as_grayscale() and made it take any
numpy array as input.
2018-05-24 20:59:45 -04:00
Davis King
89ffae6126 Added load_grayscale_image() to the Python API 2018-05-24 20:59:19 -04:00
Davis King
840bb5bc64 Updated to work with new extract_image_4points() interface. 2018-05-24 20:40:23 -04:00
Davis King
d3bd9d61e1 Added extract_image_4points() to the Python API. 2018-05-23 23:06:48 -04:00
Davis King
7eb1d2d4d5 Added angle_between_lines() to the Python API. 2018-05-23 23:06:31 -04:00
Davis King
ec150f8d88 Fixed warnings and sorta bugs. 2018-05-23 13:09:28 -04:00
Davis King
39a1329831 Added a version of transform_image() that works with projective transforms to
the Python API.
2018-05-22 23:02:42 -04:00
Davis King
a67bdd8d70 Added point_transform_projective, find_projective_transform(), and inv() to
the Python API.
2018-05-22 23:02:11 -04:00
Davis King
a18e72e516 A bit of cmake cleanup 2018-05-22 07:15:27 -04:00
Davis King
104ffddb4c Make python extension automatically enable AVX instructions if the host machine
supports them.
2018-05-21 21:21:40 -04:00
Davis King
f21ac08063 Added hough_transform, remove_incoherent_edge_pixels(),
normalize_image_gradients(), line, signed_distance_to_line(),
distance_to_line(), reverse(), intersect(), count_points_on_side_of_line(),
count_points_between_lines(), dot(), and normalize() to Python API.
2018-05-21 21:20:18 -04:00
Davis King
a190a1c242 Added equalize_histogram() and resize_image() to the Python API. 2018-05-20 22:34:49 -04:00
Davis King
1df5227e3e Added hysteresis_threshold() and sobel_edge_detector() bindings in the Python API. 2018-05-20 22:13:00 -04:00
Davis King
5df921a226 Made the python API for image_window accept any image type. 2018-05-20 22:11:41 -04:00
Davis King
a3ca78de9c Added convert_rgb_to_grayscale(), pyramid_down, find_bright_keypoints(),
find_bright_lines(), find_dark_lines(), find_dark_keypoints(),
suppress_non_maximum_edges(), and find_peaks() to the Python API.
2018-05-20 19:21:34 -04:00
Davis King
40da8bf72f Added length() for point and dpoint in the Python API. 2018-05-20 19:20:09 -04:00
Davis King
52e7ab68bc Made image_window use numpy_image explicitly so it benefits from numpy_image's
automatic binding.
2018-05-20 18:43:50 -04:00
Davis King
cafd6a0ad5 Added centered_rect() and centered_rects() to Python API. Also
added the *_corner() routines to rectangle and drectangle and made these
objects constructable from instances of each other.
2018-05-20 18:43:15 -04:00
Davis King
c18202842e Made point and dpoint constructable from each other. 2018-05-20 18:41:57 -04:00
Davis King
70c6f7b84e Minor cleanup 2018-05-20 10:19:55 -04:00
Davis King
c0097a7826 Added dpoint to the python API. 2018-05-20 10:17:53 -04:00
Davis King
da943c691e Added label_connected_blobs_watershed(), convert_image(),
and convert_image_scaled() to the python API.
2018-05-20 10:09:19 -04:00
Davis King
e15fcbd39e Added the following things to the python API: gaussian_blur(), label_connected_blobs(),
randomly_color_image(), jet(), skeleton(), find_line_endpoints(), get_rect(), shrink_rect(),
grow_rect(), and image_gradients.
2018-05-19 23:43:28 -04:00
Davis King
26701f7342 Fixed typo in docs 2018-05-19 14:38:29 -04:00
Davis King
1f727f930b Fixed broken unit test. 2018-05-19 14:14:43 -04:00
Davis King
7e7d8e9071 Added python interface to threshold_image() and partition_pixels(). 2018-05-19 13:12:47 -04:00
Davis King
27dbbe2de1 Renamed dlib.save_rgb_image() to dlib.save_image() 2018-05-19 13:12:27 -04:00
Davis King
0e0675715a Improved python docs 2018-05-17 07:18:13 -04:00
Davis King
851d70a5b4 A bit of cleanup 2018-05-07 07:24:29 -04:00
Davis King
1a297363c6 Fixed spelling error in message. 2018-05-03 16:35:33 -04:00
Davis King
46052db07c Turn LTO back on. 2018-04-28 16:44:40 -04:00
Davis King
43e5f42ef5 Added numpy_image templated class that makes a numpy array
conform to dlib's generic image interface.  This makes dealing with
numpy images in pybind11 modules much nicer.
2018-04-28 08:52:25 -04:00
Davis King
30101dff48 Updated about to talk about new part labeling method. 2018-04-19 22:45:58 -04:00
Davis King
52322e5ae2 Made convert_to_numpy() take an rvalue reference so that it's really explicit
that it's going to move the matrix into the result.
2018-04-17 22:58:13 -04:00
visionworkz
e8faced822 Add basic image io and remove python C-API refs from numpy_returns.cpp (#1258)
* Fixed reference count issue

* Fixed refcount issue in Python dlib.jitter_image and dlib.get_face_chips

* Consolidation of https://github.com/davisking/dlib/pull/1249

* Fixed build issue

* Fixed: Paths in a pytest file should be relative to dlib root

* Skip numpy return tests for Python 2.7 or if Numpy is not installed

* Enabled numpy returns tests on Python 2.7 using cPickle.dumps
2018-04-17 22:49:25 -04:00
visionworkz
509d62351e Fixed refcount issue in Python dlib.jitter_image and dlib.get_face_chips (#1246)
* Fixed reference count issue

* Fixed refcount issue in Python dlib.jitter_image and dlib.get_face_chips
2018-04-10 09:29:08 -04:00
Davis King
24ac9bc43f A bit of cmake cleanup 2018-04-06 17:43:49 -04:00
visionworkz
0db8713a6d Fixed reference count issue (#1222) 2018-03-31 07:38:52 -04:00
Davis King
60a4af67e8 Added more unit tests 2018-03-17 17:10:44 -04:00
Davis King
2cff3f4e00 Added a note about disabling LTO 2018-03-17 17:10:31 -04:00
Davis King
3e781f6f61 Added interface to the global_function_search object. 2018-03-17 17:00:08 -04:00
Davis King
49ec319ce4 Added rect_filter and find_optimal_rect_filter() to python API. 2018-03-03 18:45:16 -05:00
Davis King
1c26be904c Added operator + support for dlib.rectangle. 2018-03-03 17:21:23 -05:00
Davis King
09f36dbf47 Added python interface to cuda::set_device() and other relevant
functions.
2018-02-21 21:51:48 -05:00
Davis King
a37c5e7c2b Add the example program contents as a test as well. 2018-02-19 13:31:07 -05:00
Morten Hustveit
9691c194c0 Added support for variadic Python functions in find_max_global. (#1141)
* Added support for variadic Python functions in find_max_global.

* Add test for find_{min,max}_global on variadic functions.
2018-02-19 13:26:45 -05:00
Davis King
87aa290c04 Fixed pybind11 not doing the overload resolution correctly on the cnn_face_detector's operator() in Python. 2018-02-14 22:01:22 -05:00
Davis King
ca1c7af21b Added missing , in output 2018-02-13 19:09:54 -05:00
HarveyBrezinaConniffe
46e85e45c6 Added set_dnn_prefer_smallest_algorithms() (#1128)
* Added set_dnn_prefer_smallest_algorithms()

* Added description for set_dnn_prefer_smallest_algorithms();w

* Changed architectures to algorithms.
2018-02-13 16:28:46 -05:00
Davis King
52edc0d2e7 Fixed incorrect input validation. 2018-02-11 22:40:30 -05:00
Davis King
0040eb7fa8 removed debugging print statement. 2018-02-11 22:38:27 -05:00
Davis King
aca8087371 Added num_threads to shape_predictor_training_options. 2018-02-11 18:15:40 -05:00
Davis King
2a26521b0b - Added rectangless.
- Moved all uses of PYBIND11_MAKE_OPAQUE to a common header to avoid possilbe ODR violations.
- Added python binding for make_bounding_box_regression_training_data().
2018-02-11 17:19:04 -05:00
Davis King
5bde5c526e Made the index outputs of run_multiple_rect_detectors be integers rather than doubles. 2018-02-10 17:12:13 -05:00
Davis King
2d3dd3c830 Exposed the image_dataset_metadata routines for parsing XML datasets to Python. 2018-02-10 12:44:39 -05:00
Davis King
8fd9c26f6e Made dlib.point() have writable x and y properties. 2018-02-10 12:37:14 -05:00
Davis King
fa39e51864 Added a __time_compiled__ field to the python API. 2018-02-10 10:08:25 -05:00
Davis King
95bce7a10c Added probability_that_sequence_is_increasing() to python API 2018-02-03 18:18:45 -05:00
Davis King
7481ef1e21 Fixed problems in python doc generation. 2018-02-03 12:13:54 -05:00
Davis King
2885394359 Let pybind11 produce nice documentation. 2018-02-03 09:13:27 -05:00
ksemb
14cbb804a9 Add Python rvm_trainer and init functions (#1100) 2018-02-02 06:14:03 -05:00
Davis King
989e72e05a Added global properties that tell how dlib was compiled. 2018-01-22 07:36:53 -05:00
Davis King
0cfef582ca Fixed the code ignoring the angle scan, oops. 2018-01-19 18:48:25 -05:00
Davis King
2a2bc9cef1 Different versions of python disagree on what exception gets thrown. So just
check for any exception.
2018-01-16 21:26:56 -05:00
Davis King
99b0f687b4 Fixed test to really work if numpy isn't installed. 2018-01-16 21:00:54 -05:00
Davis King
a9ca83d228 Disable these tests if numpy isn't installed 2018-01-16 20:14:37 -05:00
Davis King
28f9111901 Fixed simd warning message not working. 2018-01-16 19:23:08 -05:00
Davis King
9e3b19c859 Added warning about simd instructions 2018-01-16 07:26:46 -05:00
Davis King
635747e654 Cleaned up setup.py and the python cmake script. 2018-01-16 07:24:47 -05:00
Davis King
1e051f1a60 Made test work in python3 2018-01-15 22:29:37 -05:00
Mischan Toosarani-Hausberger
077a3b60e7 Replace boost::python with pybind11 (#1040)
* Replace boost::python with pybind11

* Replace add_python_module with pybind11_add_module

* Fix clang error on type-dependent expression
2018-01-15 14:41:40 -05:00
Davis King
c68bb4e785 Changed the behavior of imglab's --flip option. It will now attempt to adjust
any object part labels so that the flipped dataset has the same average part
layout as the source dataset.  I added a --flip-basic that behaves like the old
--flip.  However, most people flipping a dataset with part annotations will
want to use --flip.
2018-01-14 09:16:50 -05:00
Davis King
c13ca8ebe7 Just moved code around to clean things up a little. 2018-01-13 14:36:55 -05:00
Davis King
ced9f6f407 Make the global optimizer work in python3 2017-12-19 22:24:31 -05:00
Davis King
d5097f72db Added python bindings for count_steps_without_decrease() and count_steps_without_decrease_robust() 2017-12-12 21:57:04 -05:00
Davis King
be8269900c The previous commit broke for pyhton2 but fixed python3. This should deal with
numpy's import_array() in a more robust way.
2017-12-09 20:52:07 -05:00
Davis King
7b38ea6f2d Numpy's import_array() macro in python3 requires the calling function to return
void*.  But the previous code didn't so it wouldn't compile.  Fixed that
problem.
2017-12-09 19:51:20 -05:00
Davis King
4ff442324b cleaned up cmake 2017-12-08 10:09:30 -05:00
visionworkz
ac292309c1 Exposed jitter_image in Python and added an example (#980)
* Exposed jitter_image in Python and added an example

* Return Numpy array directly

* Require numpy during setup

* Added install of Numpy before builds

* Changed pip install for user only due to security issues.

* Removed malloc

* Made presence of Numpy during compile optional.

* Conflict

* Refactored get_face_chip/get_face_chips to use Numpy as well.
2017-12-08 09:59:27 -05:00
Davis King
95d16fd05e Added a missing assert. 2017-12-05 15:10:41 -05:00
Davis King
5e8e997bf7 Added python interface to find_min_global() 2017-12-02 08:55:02 -05:00
Davis King
c3f2c1dfcb Added a python interface to find_max_global() 2017-11-25 10:07:00 -05:00
hannometer
2f531f1175 imglab: select next/previous image with 's' and 'w' (#964)
* imglab: select next/previous image with 's' and 'w'

* imglab: make 'w' and 's' keys behave like UP and DOWN keys; add 'about' text
2017-11-22 05:42:15 -05:00
Davis King
8b5c04d075 Updated code to work with new regression test output. 2017-11-10 17:42:40 -05:00
Davis King
1e877b1917 Changed graph construction for chinese_whispers() so that each face is always
included in the edge graph.  If it isn't then the output labels from
chinese_whispers would be missing faces in this degenerate case.  So basically this fixes a bug
where chinese_whispers(), when called from python, would sometimes return a labels array
that doesn't include labels for all the inputs.
2017-10-27 19:30:58 -04:00
Davis King
aa93c8f861 Updated python code to use the new dlib::jitter_image() instead of hacking it
out of the random_cropper.
2017-10-25 05:42:31 -04:00
Davis King
38a2846dda More cmake cleanup 2017-10-16 21:36:18 -04:00
Davis King
5b4206f97c Suppress compiler warnings 2017-10-16 21:34:00 -04:00
Hung-Wei Chiu
ea9aae0f5f Fix warning (#851)
* remove unused variable

* modify variable type from int to size_t

* fix previous delete, we need to call chinese_whispers here but we don't need its result now
2017-09-29 11:20:11 -04:00
Varun Chatterji
5f26972551 Added code to get face_chip images.. 2017-09-19 13:08:51 +08:00
Varun Chatterji
9fe352d696 Added size and padding as optional parameters 2017-09-18 19:54:26 +08:00
Davis King
532552627a Cleaned up code and comments.
In particular, these new functions don't need to be inside the face
recognition class.  So I moved them out.  I also fixed many incorrect
copy/pasted comments and clarified parts of the example code.
2017-09-16 14:53:11 -04:00
Davis King
5cf80dda6a Merge branch 'master' of git://github.com/visionworkz/dlib into visionworkz-master 2017-09-16 14:18:44 -04:00
Davis E. King
0f8b227e47 Fixed typo in comment 2017-09-15 21:02:39 -04:00
Davis King
fb5cae063b Added this program for historical reference. 2017-09-15 20:20:08 -04:00
Davis King
f84194f643 Upgraded face recognition input validation checks to allow use of 5 point face
landmarking models.
2017-09-15 19:56:38 -04:00
Varun
93a1aba096 Added threshold to clustering call 2017-09-10 06:15:42 +08:00
Davis King
85c94dc1e4 removed extraneous print statement. 2017-09-07 19:11:18 -04:00
Visionworkz
8b48c09c7b Added face clustering example to Python API 2017-09-06 02:05:42 +08:00
Davis King
14ae224ecd Made it so you can press END or i to ignore boxes in imglab. I did this
because it's a much less stressing hand motion to hit END that i in most cases.
2017-09-03 12:54:18 -04:00
Davis King
972bf3c46b Made the box colors in imglab spread more evenly over the color space. 2017-09-01 17:38:41 -04:00
Guillaume Ramé
bbf3d987b2 improvements to cnn face detection python interface (#780)
* improvements to cnn face detection interface

* mmod rectangle object renaming. possibility to set batch size in multi image detection. Added check to make sure images are all the same size.
2017-08-27 18:40:31 -04:00
Davis King
678728dc23 Made imglab --cluster ignore ignored boxes when doing all aspects of clustering. 2017-08-25 22:29:40 -04:00
Davis King
30ca8b4228 Fully qualified boost::python::list to hopefully avoid compiler errors in some environments. 2017-08-24 18:41:07 -04:00
Davis King
ba430be591 Make DLIB_ASSERT statements not abort the python interpreter, but just trigger an exception. 2017-08-19 08:48:48 -04:00
Adam Geitgey
b6d2329c5e Add a python wrapper for using the mmod face detector (#753) 2017-08-18 16:30:33 -04:00
Davis King
e7fe423bc4 Added --sort and also the ability to propagate boxes from one image to the
next using dlib::correlation_tracker.
2017-07-18 22:19:29 -04:00
Davis King
39be45ada2 Made is so pressing e in imglab toggles between views of the image where the
histogram is equalized or unmodified.  This way, if you are looking at
particularly dark or badly contrasted images you can toggle this mode and maybe
get a better view of what you are labeling.
2017-06-19 20:54:45 -04:00
Davis King
ba72c2f95c Updated code to work with new random_cropper interface. 2017-06-18 08:11:54 -04:00
Davis King
74fbca45ca Changed the converter so that, rather than producing one python file with
everything in it, it now makes a python file as before but an additional binary
file with all the weights in it.  This way, if you are working with a network
with a very large number of weights you won't end up with a crazy large python
script.
2017-06-04 10:06:44 -04:00
Davis King
88383a848b Made the converter handle caffe's odd pooling layer output size calculations. 2017-05-28 11:07:02 -04:00
Davis King
a88f1bd8f2 Made the converter add zero padding layers when needed by Eltwise to replicate
the behavior of dlib's add_prev layers.
2017-05-24 07:24:12 -04:00
Davis King
984b694962 Made error message slightly better. 2017-05-22 19:11:00 -04:00
Davis King
cbda2b9e33 Changed caffe converter to require the user to specify the input tensor size
when the converter is run.
2017-05-22 19:06:55 -04:00
Davis King
10d3f93333 Dlib and caffe actually do use max pooling layers with padding in the same way.
So I just removed the error check that was preventing the conversion from
proceeding in that case.  I also added more useful output messages about
setting input tensor dimensions.
2017-05-19 20:16:40 -04:00
Davis King
fe3e86a186 Fixed spelling error 2017-05-07 19:40:42 -04:00
Davis King
c479219811 Renamed file 2017-05-07 19:08:41 -04:00
Davis King
2f74b3a03a Improved example python script 2017-05-07 19:07:18 -04:00
Davis King
84d54e2ff4 Added more comments 2017-05-07 17:16:08 -04:00
Davis King
16cd104b1d Fixed affine_fc and clarified error message. 2017-05-07 16:57:34 -04:00
Davis King
c41b30a8e6 Added missing sig and prelu layer support. 2017-05-07 16:23:35 -04:00
Davis King
af40aa1b0a Cleaned up how the output is output. 2017-05-07 15:49:19 -04:00
Davis King
7494f51d9a Added support for all the other dlib layers that make sense. 2017-05-07 15:26:18 -04:00
Davis King
99b06476c9 Added a simple tool to convert dlib model files, which are saved as XML files,
to caffe models.  Not all layers are supported yet, but it works on the net
from the first dlib dnn example program.  Will add the rest of the layers soon.
2017-05-06 15:02:38 -04:00
Davis King
e0a1437670 Made the title bar show the current image's number. 2017-03-30 10:43:49 -04:00
Davis King
e73b9e3aa9 Changed from ctrl to alt because otherwise it's easy to accidentally hit ctrl up and jump when you don't meant to while pruning an image list. 2017-03-27 21:00:37 -04:00
Davis King
a1d42b2552 Changed to ctrl+d since it's easier to press. 2017-03-27 20:13:39 -04:00
Davis King
fad836df23 Made it so you can remove images by pressing ctrl+r. 2017-03-27 20:11:04 -04:00
Davis King
072c9d9d4d Fixed cmake file to correctly enable C++11 by default. 2017-03-09 20:14:42 -05:00
Davis King
84cd330c70 Upped imglab version number 2017-03-04 07:58:55 -05:00
Davis King
cf66f6b1b0 clarified documentation 2017-03-01 05:26:22 -05:00
Davis King
655b7f7fd1 Switched cmake link names to dlib::dlib 2017-02-28 05:05:25 -05:00
Alain Vaucher
b41455fd26 Change minimum CMake version that supports the introduced features 2017-02-27 18:23:28 +01:00
Davis King
c182adbf4b Added a python interface to the face recognition DNN model. 2017-02-12 20:37:18 -05:00
Davis King
bdbf7bb8da Fixed documentation 2017-01-25 06:59:08 -05:00
Frank
7ef7ba84b3 Fix imglab readme typo in cd path (#400) 2017-01-16 11:47:06 -05:00
Avi Haiat
23785d5342 Expose python binding for running multiple detectors at once (#328)
* Expose python binding for running multiple detectors at once

* Remove unwanted typedef
2016-11-12 07:54:48 -05:00
Avi Haiat
85e2bcce02 Add option --rm-other-labels to imglab (#323)
* Add option --rm-other-labels to imglab

* Add support for comma separated list of labels
2016-11-09 20:36:52 -05:00
Davis King
85d421c356 Added --rmignore 2016-10-16 19:51:19 -04:00
Davis King
0848616d99 Improved xml logging for --resample 2016-10-16 16:21:28 -04:00
Davis King
f8fcfcd0b4 removed --extract-chips 2016-10-16 16:19:24 -04:00
Davis King
968322bcf8 Fixed confusing -h docs 2016-10-16 16:10:44 -04:00