dlib.cpp 1.92 KB
Newer Older
1
// Copyright (C) 2015 Davis E. King (davis@dlib.net)
2
// License: Boost Software License   See LICENSE.txt for the full license.
3

4
#include <pybind11/pybind11.h>
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace py = pybind11;

void bind_matrix(py::module& m);
void bind_vector(py::module& m);
void bind_svm_c_trainer(py::module& m);
void bind_decision_functions(py::module& m);
void bind_basic_types(py::module& m);
void bind_other(py::module& m);
void bind_svm_rank_trainer(py::module& m);
void bind_cca(py::module& m);
void bind_sequence_segmenter(py::module& m);
void bind_svm_struct(py::module& m);
void bind_image_classes(py::module& m);
void bind_rectangles(py::module& m);
void bind_object_detection(py::module& m);
void bind_shape_predictors(py::module& m);
void bind_correlation_tracker(py::module& m);
void bind_face_recognition(py::module& m);
void bind_cnn_face_detection(py::module& m);
void bind_global_optimization(py::module& m);
void bind_numpy_returns(py::module& m);
27
28

#ifndef DLIB_NO_GUI_SUPPORT
29
void bind_gui(py::module& m);
30
#endif
31

32
PYBIND11_MODULE(dlib, m)
33
{
Davis King's avatar
Davis King committed
34
35
    // Disable printing of the C++ function signature in the python __doc__ string
    // since it is full of huge amounts of template clutter.
36
37
    py::options options;
    options.disable_function_signatures();
Davis King's avatar
Davis King committed
38

39
40
#define DLIB_QUOTE_STRING(x) DLIB_QUOTE_STRING2(x)
#define DLIB_QUOTE_STRING2(x) #x
41
    m.attr("__version__") = DLIB_QUOTE_STRING(DLIB_VERSION);
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    bind_matrix(m);
    bind_vector(m);
    bind_svm_c_trainer(m);
    bind_decision_functions(m);
    bind_basic_types(m);
    bind_other(m);
    bind_svm_rank_trainer(m);
    bind_cca(m);
    bind_sequence_segmenter(m);
    bind_svm_struct(m);
    bind_image_classes(m);
    bind_rectangles(m);
    bind_object_detection(m);
    bind_shape_predictors(m);
    bind_correlation_tracker(m);
    bind_face_recognition(m);
    bind_cnn_face_detection(m);
    bind_global_optimization(m);
    bind_numpy_returns(m);
62
#ifndef DLIB_NO_GUI_SUPPORT
63
    bind_gui(m);
64
#endif
65
}