A toolkit for making real world machine learning and data analysis applications in C++

Overview

dlib C++ library Travis Status

Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. See http://dlib.net for the main project documentation and API reference.

Compiling dlib C++ example programs

Go into the examples folder and type:

mkdir build; cd build; cmake .. ; cmake --build .

That will build all the examples. If you have a CPU that supports AVX instructions then turn them on like this:

mkdir build; cd build; cmake .. -DUSE_AVX_INSTRUCTIONS=1; cmake --build .

Doing so will make some things run faster.

Finally, Visual Studio users should usually do everything in 64bit mode. By default Visual Studio is 32bit, both in its outputs and its own execution, so you have to explicitly tell it to use 64bits. Since it's not the 1990s anymore you probably want to use 64bits. Do that with a cmake invocation like this:

cmake .. -G "Visual Studio 14 2015 Win64" -T host=x64 

Compiling your own C++ programs that use dlib

The examples folder has a CMake tutorial that tells you what to do. There are also additional instructions on the dlib web site.

Alternatively, if you are using the vcpkg dependency manager you can download and install dlib with CMake integration in a single command:

vcpkg install dlib

Compiling dlib Python API

Before you can run the Python example programs you must compile dlib. Type:

python setup.py install

Running the unit test suite

Type the following to compile and run the dlib unit test suite:

cd dlib/test
mkdir build
cd build
cmake ..
cmake --build . --config Release
./dtest --runall

Note that on windows your compiler might put the test executable in a subfolder called Release. If that's the case then you have to go to that folder before running the test.

This library is licensed under the Boost Software License, which can be found in dlib/LICENSE.txt. The long and short of the license is that you can use dlib however you like, even in closed source commercial software.

dlib sponsors

This research is based in part upon work supported by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA) under contract number 2014-14071600010. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of ODNI, IARPA, or the U.S. Government.

Issues
  • QUESTION : is yolov3 possible in DLIB

    QUESTION : is yolov3 possible in DLIB

    I am trying to define yolov3 using dlib's dnn module. I'm stuck with the darknet53 backbone, as I want it to output the outputs of the last three layers. So far i have this:

    using namespace dlib;
                        
    template <int outc, int kern, int stride, typename SUBNET> 
    using conv_block = leaky_relu<affine<con<outc,kern,kern,stride,stride,SUBNET>>>;
    
    template <int inc, typename SUBNET>
    using resblock = add_prev1<conv_block<inc,3,1,conv_block<inc/2,1,1,tag1<SUBNET>>>>;
    
    template<int nblocks, int outc, typename SUBNET>
    using conv_resblock = repeat<nblocks, resblock<outc,
                          conv_block<outc, 3, 2, SUBNET>>>;
    
    template<typename SUBNET>
    using darknet53 = tag3<conv_resblock<4, 1024,
                      tag2<conv_resblock<8, 512,
                      tag1<conv_resblock<8, 256,
                      conv_resblock<2, 128,
                      conv_resblock<1, 64,
                      conv_block<32, 3, SUBNET
                      >>>>>>>>>;
    

    Is it possible for darknet53 to output tag1, tag2 and tag3?

    opened by pfeatherstone 83
  • Optimize dlib for POWER8 VSX

    Optimize dlib for POWER8 VSX

    Enable and optimize support for POWER8 VSX SIMD instructions on PPC64LE Linux to dlib/simd.

    $$$$ Financial bounties available. Any reasonable suggested value will be seriously considered.

    I welcome contact / replies from developers in the dlib community who are interested to work on this project.

    paid-bounty 
    opened by edelsohn 79
  • Example of DCGAN

    Example of DCGAN

    Hi, I would like to contribute a DCGAN example to dlib.

    I have implemented a version of Pytorch DCGAN for C++.

    However, I would need some guidance with some things I don't know how to do. I am wondering on how I should proceed. Should I attach my current code here (around 150 lines), or make a pull request, even if the code is not able to learn anything? Maybe @edubois can help out, since he stated that he managed to make it work on https://github.com/davisking/dlib/issues/1261

    Thanks for your hard work on dlib.

    enhancement 
    opened by arrufat 67
  • Arbitrary sized FFTs using modified kissFFT as default backend and MKL otherwise

    Arbitrary sized FFTs using modified kissFFT as default backend and MKL otherwise

    This PR adds a C++ port of kissFFT as the default backend of dlib's fft routines. All the kiss code is inserted into the dlib namespace to avoid conflicts with user code that may or may not be using original (C) kissFFT. All MKL fft code is put into it's own separate header file. Now dlib/matrix_fft.h simply calls the right wrappers depending on a pre-processor macro (as before). I've removed the FFTW wrapper code as per @davisking's request as the fftw planner isn't thread safe. I've also removed the original fft backend code, again, as per @davisking's request.

    Note that this PR isn't quite ready yet. Need more unit tests. Not quite sure why MKL wrappers only worked for matrix<complex<double>> before. There's no reason why it couldn't work for matrix<complex<float>> if using DFTI_SINGLE instead of DFTI_DOUBLE. (maybe user code had to do a cast?) So need more units tests for MKL wrappers.

    Not quite happy with the number of copies at the moment. When passing const matrix_exp<EXP>& data as input, there are 2 copies: one to evaluate the matrix expression to matrix<typename EXP::type> and one to do either the in-place fft (copy is done in the implementation details of the fft functions) or out-of-place fft (copy is done explicitly in dlib/matrix_fft.h). For example, if you want to do the fft of std::vector<std::complex>, you have to use dlib::mat which returns a matrix expression then dlib::fft will evaluate that to dlib::matrix<std::complex<float>>. So there is a copy of std::vector to dlib::matrix that is unnecessary. Could add some function overloads to support std::vector. Don't know what's the best thing to do without dirtying the API. Could benefit from @davisking's advice.

    I think if we've gone this far, we should support real FFTs so the requirement that input should be complex vanishes. Output will be complex though. Both KISS and MKL support this so there shouldn't be a lot of leg work. More unit tests.

    opened by pfeatherstone 56
  • Semantic Segmentation Functionality

    Semantic Segmentation Functionality

    I'm interested in using dlib for semantic segmentation. I think the only necessary features would be:

    • Loss function - it doesn't look like loss_multiclass_log would work for this
    • "Unpooling" upsampling layer - there are a few ways to do this

    Is this something you're interested in supporting? I'm planning to add this functionality regardless, just wanted to check in.

    Regarding implementation, would the upsampling be something you would want added to the pooling class or its own upsample class?

    enhancement help wanted 
    opened by davidmascharka 53
  • Adding an install target to dlib's CMakeLists

    Adding an install target to dlib's CMakeLists

    This PR covers the first part of items discussed in #34, namely, the installation.

    A follow-up PR (hopefully tomorrow) should cover the 2nd part, namely, the generation and installation of dlibConfig.cmake

    opened by severin-lemaignan 51
  • Arbitrary FFT sizes

    Arbitrary FFT sizes

    Feature suggestion: allow the fft routine to do arbitrary sized FFTs. Let FFTW, lapack, BLAS or whatever do the magic of choosing the correct kernels for the input

    enhancement 
    opened by pfeatherstone 47
  • Multiclass object detector

    Multiclass object detector

    Hi, its been some time but once again its me with some questions/issues. This might be a longer post very sorry for it. Thanks a lot in advance + for the great work you did with this project.

    Its about the multiclass detector based on cnn. I tried to create my own detection tool, with my own objects. Therefore i labeled 8000 images by hand in 3 categories.

    I am running the trainer for a very long time now yet the loss is still over 1:

    step#: 37114 learning rate: 0.1 train loss: 1.09005 test loss: 1.34749 steps without apparent progress: train=6512, test=70

    Edit: Also if it stop and test it detects 0 boxes. (yes i had a look at the faq. all the images are labeled correctly and contain 1-4 boxes per image)

    I also had a look at your faq and so on. All the images are labeled corretly. However there a some thinks which i find rather wierd. loss: loss_mmod (detector_windows:(56x70,70x46,86x30,30x82,70x33,30x121,65x70,70x43,37x70,90x30,30x81,30x160,70x58,47x70,70x33,30x79,114x30,155x30,30x108,30x145,70x46,60x70,83x30,34x70,148x30,30x111,30x190,70x34,259x30,111x30,368x30,497x30), loss per FA:1, loss per miss:1, truth match IOU thresh:0.5, overlaps_nms:(0.528188,0.952017), overlaps_ignore:(0.5,0.95))

    it found 32 options based on my iamges. my images are allowed to be rotated by pretty much 360 degree. I thought it would be better to set the max roation degree to something low since it differs so much. Is it ok to set it to a very high number? Will this decease the amount of options?

    1. i sometimes get messages like this: Warning, ignoring object. We encountered a truth rectangle with a width and height of 199 and 30. The image pyramid and sliding windows can't output a rectangle of this shape. This is either because (1) the final layer's features have too large of a stride across the image, limiting the possible locations the sliding window can search or (2) because the rectangle's aspect ratio is too different from the best matching detection window, which has a width and height of 86 and 30.

    I understand the basic message but i cant really figure out what to do to fix the problem.

    1. If i look at the crops the random cropüer produces, naturally sometimes some boxes are partly outside of the crop (it crops out a part of the image ;)) is this normal or something wrong?

    And last if after nearly 40.000 steps the loss is still above one, does it make sense to wait and hope it will work out?

    thanks and regards

    inactive 
    opened by VisionEp1 47
  • can't install dlib on windows 10 for python

    can't install dlib on windows 10 for python

    hi, I have windows 10 64 bit and i try and try to install dlib for python with this command: python setup.py install but i get error below: running install running bdist_egg running build Detected Python architecture: 32bit Detected platform: win32 Removing build directory C:\Users\Avatar\Desktop\dlib-master./tools/python/build Configuring cmake ... -- Building for: Visual Studio 12 2013 -- The C compiler identification is MSVC 18.0.21005.1 -- The CXX compiler identification is MSVC 18.0.21005.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Could NOT find Boost -- Found PythonLibs: C:/Python27/libs/python27.lib (found suitable version "2.7.9+", minimum required is "2.6") error: cmake configuration failed!

    i install cmake GUI and dont know haow can i set it. and i build from source with cmake command like in readme file: mkdir build; cd build; cmake .. ; cmake --build .

    at the end i say that, i want use dlib on python . does anyone can help me???

    Thanks a lot....

    opened by semsimsom 43
  • Replace boost::python with pybind11

    Replace boost::python with pybind11

    This is the initial pull request for #293

    • tested with python 3.6.3, gcc 7.2.1 and pybind11 (more recent than 2.2)
    • it depends on pybind11 to be found by find_package()
    • all python examples run
    • i've done a few review rounds to ease your review
    • no detailed testing of sub-components has been done. i'll send you a message when the pr is ready for an in-depth review.
    • if you @davisking have fly-over peek and find something disgusting, let me know ;-)
    opened by supervacuus 41
  • convert landmarks array to dlib format

    convert landmarks array to dlib format

    Hi,

    I want to use my landmarks array to extract the face descriptor. How do I convert a np.ndarray (68,2) to the _dlib_pybind11.full_object_detection ?

    I was trying to use dlib.get_face_chip in case to pass directly the aligned face but that also wants the lanmarks in the dlib format

    opened by segalinc 0
  • Unable to Install dlib for python3.6 on Centos7

    Unable to Install dlib for python3.6 on Centos7

    Expected Behavior

    Successful install of dlib in my python3.6 virtualenv.

    Current Behavior

    pip install dlib worked like a charm on macOS, but failing on centos7

    -- Disabling CUDA support for dlib.  DLIB WILL NOT USE CUDA
    -- C++11 activated.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/build/temp.linux-x86_64-3.6
    Invoking CMake build: 'cmake --build . --config Release -- -j24'
    Scanning dependencies of target dlib
    [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o
    [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
    [  4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o
    [  4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o
    [  6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o
    [  7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o
    [  7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o
    [  9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/test_for_odr_violations.cpp.o
    [  9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o
    [  9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o
    [ 10%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o
    [ 11%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o
    [ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o
    [ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o
    [ 13%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o
    [ 14%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o
    [ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o
    [ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o
    [ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o
    [ 16%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o
    [ 17%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o
    [ 17%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o
    [ 18%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_kernel.cpp.o
    [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_iostream.cpp.o
    [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_http.cpp.o
    [ 20%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o
    [ 20%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/bigint_kernel_1.h:8,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/bigint_kernel_1.cpp:5:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../vectorstream/vectorstream.h:31:34 error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/bigint_kernel_2.h:8,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/bigint_kernel_2.cpp:5:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bigint/../vectorstream/vectorstream.h:31:34 error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../stl_checked/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../stl_checked/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../stl_checked/std_vector_c.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../stl_checked.h:6,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/dir_nav_kernel_2.h:32,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/dir_nav_kernel_2.cpp:11:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../stl_checked/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_kernel_1.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_kernel_1.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/../stl_checked/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/../stl_checked/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/../stl_checked/std_vector_c.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/../stl_checked.h:6,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/dir_nav_kernel_2.h:32,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav.h:15,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/dir_nav_extensions.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/dir_nav_extensions.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/dir_nav/../dir_nav/../stl_checked/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/misc_api_kernel_1.cpp:7:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/misc_api/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_kernel_1.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/extra_logger_headers.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/extra_logger_headers.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/linker_kernel_1.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/linker_kernel_1.cpp:5:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/linker/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    [ 21%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/sockets_kernel_2.h:36,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets.h:14,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/bsp.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/bsp.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/bsp/../sockets/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_kernel_1.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_config_file.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/logger_config_file.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/logger/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    [ 22%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/gui_widgets/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/gui_widgets/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/gui_widgets/fonts.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/gui_widgets/fonts.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/gui_widgets/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    [ 22%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/sockets_kernel_2.h:36,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/sockets_kernel_2.cpp:11:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/sockets_kernel_2.h:36,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets.h:14,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/sockets_extensions.cpp:8:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockets/../sockets/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    [ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o
    [ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/async.cpp.o
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o] Error 1
    gmake[2]: *** Waiting for unfinished jobs....
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/sockets_kernel_2.h:36,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets.h:14,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/sockstreambuf.h:8,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/sockstreambuf.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/sockets_kernel_2.h:36,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets.h:14,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/sockstreambuf_unbuffered.h:8,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/sockstreambuf_unbuffered.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/sockstreambuf/../sockets/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/multithreaded_object_extension.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/multithreaded_object_extension.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads.h:1,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_kernel.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_kernel.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/logger_kernel_1.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger.h:6,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_iostream.h:8,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_iostream.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/logger_kernel_1.h:12,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger.h:6,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_http.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/server_http.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/server/../logger/../threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threaded_object_extension.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threaded_object_extension.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.cpp:10:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/multithreaded_object_extension.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/thread_pool_extension.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/thread_pool_extension.cpp:6:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o] Error 1
    In file included from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream.h:6:0,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../serialize.h:243,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/binary_search_tree_kernel_1.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_shared.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel_2.h:173,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/posix.h:4,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/threads_kernel.h:13,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/multithreaded_object_extension.h:7,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/thread_pool_extension.h:11,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/async.h:10,
                     from /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/async.cpp:9:
    /data/mtare/ipa-v2-document-trainer/document-trainer/dlib/dlib/threads/../binary_search_tree/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type 'dlib::vectorstream::vector_streambuf<CharType>::size_type'
                 size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
                                      ^
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/server/server_iostream.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/server/server_http.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/server/server_kernel.cpp.o] Error 1
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/threads/async.cpp.o] Error 1
    gmake[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
    gmake: *** [all] Error 2
    Traceback (most recent call last):
      File "setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
        self.do_egg_install()
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
        self.run_command('bdist_egg')
      File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 167, in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command
        self.run_command(cmdname)
      File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/mtare/ipa-v2-document-trainer/document-trainer/venv/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
        self.build()
      File "/usr/lib64/python3.6/distutils/command/install_lib.py", line 107, in build
        self.run_command('build_ext')
      File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "setup.py", line 134, in run
        self.build_extension(ext)
      File "setup.py", line 174, in build_extension
        subprocess.check_call(cmake_build, cwd=build_folder)
      File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j24']' returned non-zero exit status 2.
    

    Steps to Reproduce

    pip install dlib --verbose OR git clone {this repo} cd dlib python setup.py install

    • Version: 19.22.0
    • Where did you get dlib: pypi and this repo
    • Compiler: cmake (3.17.5)
    opened by mon28 3
  • Universal bounding box regression

    Universal bounding box regression

    I am trying to write a universal (i.e. class agnostic) bounding box regression method in Dlib. So given a proposed approximate bounding box the method should be able to refine the bounding box independent of the actual object class (as long as there is some sort of prominent object close to the proposed bbox).

    Would you think that Dlib's shape predictor will be capable to do that or should I rather resort to a DNN approach?

    opened by manfprantl 8
  • Does Imglab contour predict exact shape of an image using dlib?

    Does Imglab contour predict exact shape of an image using dlib?

    Iam currently working on a shape predictor using dlib for exact landmark prediction . I trained using https://www.pyimagesearch.com/2019/12/16/training-a-custom-dlib-shape-predictor/ and created one svm detector for input shape prediction. The above link is for face but here the input images are clothes. I tested it with the images,I got the output but not uniform. I will attach the annotation I created using imglab and the tested result here,

    The trained annotation image is, Screenshot from 2021-04-12 14-52-51

    The resultant output is, Screenshot from 2021-04-12 14-53-00

    The code is attached below,

    def rect_to_bb(rect):
    
        x = rect.left()
        y = rect.top()
        w = rect.right() - x
        h = rect.bottom() - y
    
        # return a tuple of (x, y, w, h)
        return (x, y, w, h)
    def shape_to_np(shape, dtype="int"):
    	import numpy as np
    	# initialize the list of (x, y)-coordinates
    	coords = np.zeros((shape.num_parts, 2), dtype=dtype)
    
    	# loop over all facial landmarks and convert them
    	# to a 2-tuple of (x, y)-coordinates
    	for i in range(0, shape.num_parts):
    		coords[i] = (shape.part(i).x, shape.part(i).y)
    
    	# return the list of (x, y)-coordinates
    	return coords
    
    # import imutils
    import dlib
    import cv2
    import imutils
    import argparse
    
    # Now let's use the detector as you would in a normal application.  First we
    # will load it from disk.
    ap = argparse.ArgumentParser()
    ap.add_argument("-p", "--shape-predictor", required=True,
    	help="path to facial landmark predictor")
    args = vars(ap.parse_args())
    detector = dlib.simple_object_detector("detector.svm")
    predictor = dlib.shape_predictor(args["shape_predictor"])
    
    # Video capture source
    
    # We can look at the HOG filter we learned.  It should look like a face.  Neat!
    win_det = dlib.image_window()
    win_det.set_image(detector)
    
    win = dlib.image_window()
    
    image = cv2.imread("/home/sharon/Documents/orbec/Working/01-04-2020/dress_model_d-lib_imlab/dataset/6.png")
    image = imutils.resize(image, width=800)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    
    
    rects = detector(gray)
    
    # loop over the face detections
    for rect in rects:
    	# convert the dlib rectangle into an OpenCV bounding box and
    	# draw a bounding box surrounding the face
    	(x, y, w, h) = rect_to_bb(rect)
    	cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 2)
    	# use our custom dlib shape predictor to predict the location
    	# of our landmark coordinates, then convert the prediction to
    	# an easily parsable NumPy array
    	shape = predictor(gray, rect)
    	shape = shape_to_np(shape)
    	# loop over the (x, y)-coordinates from our dlib shape
    	# predictor model draw them on the image
    	for (sX, sY) in shape:
    		cv2.circle(image, (sX, sY), 1, (0, 0, 255), -1)
    	# show the frame
    	cv2.imshow("Frame", image)
    	cv2.waitKey(0)
    	# key = cv2.waitKey(1) & 0xFF
    	# # if the `q` key was pressed, break from the loop
    	# if key == ord("q"):
    	# 	break
    # do a bit of cleanup
    cv2.destroyAllWindows()
    	
    # vs.stop()
    

    The annotation file for the given input image is,

    version: 1
    n_points:  47
    {
    409 196
    431 252
    499 288
    571 253
    584 196
    634 214
    671 226
    700 250
    725 282
    751 307
    781 343
    763 363
    743 378
    718 405
    695 412
    724 745
    704 444
    703 480
    704 520
    709 559
    712 598
    718 643
    722 685
    266 744
    356 216
    316 228
    295 252
    272 279
    241 306
    208 337
    236 361
    254 379
    280 409
    293 408
    290 445
    287 483
    284 523
    280 558
    278 595
    277 648
    269 690
    307 745
    349 741
    416 739
    485 736
    566 735
    638 732
    }
    

    Working env, python3,Ubuntu 18

    Did i have done any wrong here? Kindly suggest

    opened by sharon-samson 0
  • Use of

    Use of "truncated" large model for face encoding

    face_recognition version: 1.3.0 Python version: 3.92 Operating System: Windows 10 64 Description I've tried to solve "masked" face recognition and identification. An idea was to compare only some parts of faces (eyes, brows, part of nose) using a truncated face landmarks set.. So, I defined a new dlib-class, which returns “original” landmarks for the aforementioned face parts and (0. 0) – for the rest of 68 points of large model. Also I defined a new method face_encodings_masked() to work with new class:

    What I Did

    import face_recognition
    from face_recognition import api as frapi
    import numpy as np
    import dlib
    
    
    
    class Full_object_detection_masked(dlib.full_object_detection):
        def part(self, idx:int):
            if idx in range(2, 15) or idx in range(48, 68):
                return (0, 0)
            return super().part(idx)
    
        def parts(self):
            lst = dlib.points()
            for idx in range(0, 2):
                old_x = super().part(idx).x
                old_y = super().part(idx).y
                lst.insert(idx, dlib.point(old_x, old_y))
            for idx in range(2, 15):
                lst.insert(idx, dlib.point(0, 0))
            for idx in range(15, 29):
                old_x = super().part(idx).x
                old_y = super().part(idx).y
                lst.insert(idx, dlib.point(old_x, old_y))
            for idx in range(29, 36):
                lst.insert(idx, dlib.point(0, 0))
            for idx in range(36, 48):
                old_x = super().part(idx).x
                old_y = super().part(idx).y
                lst.insert(idx, dlib.point(old_x, old_y))    
            for idx in range(48, 68):
                lst.insert(idx, dlib.point(0, 0))
            return lst
        
        
    def face_encodings_masked(face_image, known_face_locations=None, num_jitters=1, model="large"):
        """
        Given an image, return the 128-dimension face encoding for each face in the image.
    
        :param face_image: The image that contains one or more faces
        :param known_face_locations: Optional - the bounding boxes of each face if you already know them.
        :param num_jitters: How many times to re-sample the face when calculating encoding. Higher is more accurate, but slower (i.e. 100 is 100x slower)
        :param model: Optional - which model to use. "large" (default) or "small" which only returns 5 points but is faster.
        :return: A list of 128-dimensional face encodings (one for each face in the image)
        """
        raw_landmarks = frapi._raw_face_landmarks(face_image,
                                            known_face_locations,
                                            model)
        masked_raw_landmarks = []
        for lm in raw_landmarks:
            masked_raw_landmarks.append(Full_object_detection_masked(lm.rect, lm.parts()))
        return [np.array(
            frapi.face_encoder.compute_face_descriptor(
                face_image,
                raw_landmark_set,
                num_jitters)) for raw_landmark_set in masked_raw_landmarks]
    
    
    image = face_recognition.load_image_file("1.jpg")
    """calling modified face_encodings with truncated face landmarks.."""
    enc_masked = face_encodings_masked(image, known_face_locations=None, num_jitters=1, model="large")
    """calling standard face_encodings with normal face landmarks.."""
    enc_full = frapi.face_encodings(image, known_face_locations=None, num_jitters=1, model="large")
    print("Difference between face encodings with partial (masked) and full landmarks:")
    print(enc_full[0] - enc_masked[0])
    

    I did hoped to see a difference .. But there is no difference: Difference between face encodings with partial (masked) and full landmarks: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]

    I've tried to explore source code for face_recognition and dlib modules but found that every appropriate method needs face landmarks as an argument... So, if the face landmarks are different - the face encodings should be different, right? But it isn't. Any ideas?

    opened by bohdansok 1
  • cudaMalloc out of memory

    cudaMalloc out of memory

    RuntimeError: Error while calling cudaMalloc(&data, new_size*sizeof(float)) in file /tmp/pip-install-xxga2353/dlib_4f93121a35234eb9a87f6fe37649ce92/dlib/cuda/gpu_data.cpp:221. code: 2, reason: out of memory

    I have a 12G gpu, When I try to run 5000 imgs face detection, the process stops at 864th image. Every time I restart the code, it still stops at 864th image and raises an error above. I have checked the image size and gpu memory. And it runs sunccessfully on several hundred images. Any reason may lead to the corruption?

    opened by monsterlyg 1
  • how to set  multi graphics device id when run some train example like dnn_semantic_segmentation_train_ex

    how to set multi graphics device id when run some train example like dnn_semantic_segmentation_train_ex

    MY PC multi graphics, i need 2rd device to train, how to set or choose?

    opened by zouwen198317 2
  • Automatically build and publish binary wheels upon release

    Automatically build and publish binary wheels upon release

    Hi, with this pull request I propose to leverage the Github Actions service to automatically build binary wheels and publish them to pypi.org. This is useful for people that might want to try dlib without the burden of compiling the project from scratch.

    The jobs defined in the yaml file compile dlib for linux, macOS and windows operating systems on amd64 architecture, and other os/architectures may be easily added afterwards (e.g. linux and macOS on arm64).

    The linux wheels are fully manylinux2010 compliant, thus they can be installed on almost every linux distro released in the past 10 years.

    The jobs are automatically triggered upon every GitHub release, but there is also the option to trigger them manually at any commit if needed.

    Here you can find an example of run tested on the forked repo. Of course the "publish to pypi.org" step failed because I didn't set the proper pypi.org credentials. If this PR is merged in order to have working upload to pypi.org the administrator of this repo must add the PYPI_PASSWORD to therepo secrets.

    The wheels are built with the default flags, so they require GUI support to work; we can discuss whether it makes sense to set DLIB_NO_GUI_SUPPORT=ON or not.

    As a final note, I'm also the maintainer of dlib-bin package, which is just a binary distribution of dlib similar to what I'm proposing to build here. If you want to take a look to the repo to get an idea on how it works this is the repo: https://github.com/alesanfra/dlib-wheels .

    Hope this will help the project, I'm available for questions and comments.

    opened by alesanfra 1
  • Defining the mlp object in the header to make it accessible to all class members.

    Defining the mlp object in the header to make it accessible to all class members.

    Hi All,

    I am kind of new to DLIB. I am trying to use the mlp neural network to train data dynamically produced by a model. I am trying to have the network as a member variable of a class so that all the class members have access to it. I was wondering if there is anyway to use dlib::mlp::kernel_1a_c in the class header as a private or public member. It seems that I am not allowed to provide arguments to

    dlib::mlp::kernel_1a_c net if I use it in the header (as expected) and there is no constructor to use it without arguments. I was wondering if there is any alternative way to do it. Your help will be greatly appreciate.

    Arash

    opened by ArashMassoudieh 1
  • Indicating the number of input variable during the runtime

    Indicating the number of input variable during the runtime

    IF YOU ARE REPORTING A BUG OR PROBLEM WITH DLIB THEN FILL OUT THE ENTIRE TEMPLATE BELOW. ISSUES ASKING QUESTIONS ABOUT WHY SOMETHING DOESN'T WORK THAT FAIL TO FILL OUT THE ENTIRE TEMPLATE WILL BE CLOSED.

    It is OK to suggest interesting improvements to dlib, even if you are not volunteering to implement them. However, the issue tracker is not a code writing service, do not ask for someone to write code for you. E.g. Do not ask for feature improvements to the example programs. If there is some feature improvement you want in an example program then it's up to you to write it.

    Before you ask a question, check Google for a solution, the dlib FAQ, or consult the dlib documentation. Every single function in dlib is documented in detail. If you obviously haven't read the documentation your issue will be closed.

    If you aren't reporting a bug or problem with dlib then delete this template and write whatever you want here.

    Expected Behavior

    Current Behavior

    Steps to Reproduce

    • Version:
    • Where did you get dlib:
    • Platform:
    • Compiler:
    opened by ArashMassoudieh 4
Owner
Davis E. King
Davis E. King
C++14 evented IO libraries for high performance networking and media based applications

LibSourcey C++ Networking Evolved LibSourcey is a collection of cross platform C++14 modules and classes that provide developers with an arsenal for r

Sourcey 1.2k Feb 18, 2021
openFrameworks is a community-developed cross platform toolkit for creative coding in C++.

openFrameworks openFrameworks is a C++ toolkit for creative coding. If you are new to OF, welcome! Build status The master branch contains the newest,

openFrameworks 8.2k Feb 19, 2021
Functional Programming Library for C++. Write concise and readable C++ code.

FunctionalPlus helps you write concise and readable C++ code. Table of contents Introduction Usage examples Type deduction and useful error messages T

Tobias Hermann 1.2k Feb 18, 2021
stb single-file public domain libraries for C/C++

stb single-file public domain (or MIT licensed) libraries for C/C++ Noteworthy: image loader: stb_image.h image writer: stb_image_write.h image resize

Sean Barrett 14.9k Feb 19, 2021
Framework for Enterprise Application Development in c++, HTTP1/HTTP2/HTTP3 compliant, Supports multiple server backends

The ffead-cpp Framework ffead-cpp is a web-framework, application framework, utilities all bundled into one. It also provides an embedded HTTP/Web-Soc

Sumeet Chhetri 425 Feb 14, 2021
All the missing SQLite functions

SQLite Plus: all the missing SQLite functions SQLite has very few functions compared to other DBMS. SQLite authors see this as a feature rather than a

Anton Zhiyanov 19 Mar 5, 2021
? A glib-like multi-platform c library

A glib-like cross-platform C library Supporting the project Support this project by becoming a sponsor. Your logo will show up here with a link to you

TBOOX 3.5k Feb 19, 2021
Fast, orthogonal, open multi-methods. Supersedes yomm11.

YOMM2 This is a complete rewrite of YOMM11, which is now deprecated. This library is much better, see here to find out why. TL;DR If you are familiar

Jean-Louis Leroy 169 Feb 15, 2021
Easy to use, header only, macro generated, generic and type-safe Data Structures in C

C Macro Collections Easy to use, header only, macro generated, generic and type-safe Data Structures in C. Table of Contents Installation Contributing

Leonardo Vencovsky 186 Feb 16, 2021
C++ Parallel Computing and Asynchronous Networking Engine

As Sogou`s C++ server engine, Sogou C++ Workflow supports almost all back-end C++ online services of Sogou, including all search services, cloud input method,online advertisements, etc., handling more than 10 billion requests every day. This is an enterprise-level programming engine in light and elegant design which can satisfy most C++ back-end development requirements.

Sogou-inc 3.8k Apr 9, 2021
EASTL stands for Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance.

EA Standard Template Library EASTL stands for Electronic Arts Standard Template Library. It is a C++ template library of containers, algorithms, and i

Electronic Arts 5.3k Feb 19, 2021
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.

JUCE is an open-source cross-platform C++ application framework used for rapidly developing high quality desktop and mobile applications, including VS

JUCE 2.7k Feb 19, 2021
Embedded Template Library

Embedded Template Library (ETL) Motivation C++ is a great language to use for embedded applications and templates are a powerful aspect. The standard

Embedded Template Library 758 Feb 18, 2021
An open-source C++ library developed and used at Facebook.

Folly: Facebook Open-source Library What is folly? Folly (acronymed loosely after Facebook Open Source Library) is a library of C++14 components desig

Facebook 16.3k Feb 19, 2021