Giter Site home page Giter Site logo

dlib-face-recognition's Introduction

dlib-face-recognition

Current Crates.io Version

Inspired by a similar python library, dlib-face-recognition is a Rust library that binds to certain specific features of the dlib C++ library.

This repository will dedicate itself to improve the library's content.

These include:

  • An FHOG-based face detector.
  • A CNN-based face detector (slower, but more powerful).
  • A face landmark predictor for identifying specific landmarks (eyes, nose, etc) from face rectangles.
  • A face encoding neural network for generating 128 dimensional face encodings that can be compared via their euclidean distances.

Original Working

The original work is here (unmaintaned; since Aug 2021).

Building

Supported Platforms

  • Linux { aarch64, x86_64 }
    • ArchLinux
    • Ubuntu 20.04
  • MacOS { aarch64, x86_64 }
    • Apple Silicon (Apple M1)
  • Windows { x86_64 }
    • Windows 10

For better maintenance, please let us know whether the other platforms support it. Besides, you may claim us whether the specific platform should support it through Issues .

Dependencies

  • cmake
  • Blas
  • Openblas (optional; overrides blas for better performance when enabling openblas feature )
  • dlib (optional; can be skipped by enabling build-native feature)
  • lapack

For Windows, vcpkg may help building both Blas and lapack . For other platforms such as Linux, package managers should support installing them.

Installing Dependencies

ArchLinux
sudo pacman -S blas-openblas cmake

# optional[dlib]
paru -S dlib

Building Native library

dlib-face-recognition requires dlib to be installed. You can either provide a existing system-wide installation, or build it with this library.

  • To build it in compile-time:
    • cargo build --features build-native
  • To use a system-wide dependency:
    • cargo build

The C++ library dlib will be installed via dlib-face-recognition-sys when the build-native feature flag is enabled.

For the build, this library uses cmake , so please make sure to have cmake .

The build-native flag is disabled by default, offering increased build times.

Building Rust package

dlib-face-recognition includes a embed-all feature flag that can be used with cargo build --features embed-all .

embed-all will enable the Default::default implementations the matching structs. These will search for the /files folder, and if a file doesn't exist it will be downloaded at runtime.

It is recommended to acquire the files before compile/runtime and set them in a protected location. The embed-all flag is disabled by default, offering increased build times.

Testing

There is one included test to recognize, and draw a face's points:

  • cargo run --features embed-all --example draw -> To run the example.

There is two files to benchmark the code, and test some functions:

  • cargo test --features embed-all --test benchmarks -> To run the benchmarks.
  • cargo test --features embed-all --test utilities_tests -> To run the utilities tester.

Examples

For more information on examples: https://github.com/ulagbulag/dlib-face-recognition/tree/master/examples/README.md

dlib-face-recognition's People

Contributors

abhizer avatar expenses avatar hokim98 avatar jalil-salame avatar jsanchesdovichi avatar leofidus avatar moeal-ani avatar ohmyvolk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dlib-face-recognition's Issues

Cargo build failures on windows `

cargo build with dlib-face-recognition = {version = "0.3.2", features = ["embed-all"]} set in cargo.toml end up failed with message:
error: could not find native static library dlib, perhaps an -L flag is missing?

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 11 Enterprise
OS Version: 10.0.22000 N/A Build 22000

cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33130 for x86
Copyright (C) Microsoft Corporation. All rights reserved.

vcpkg list
blas:x64-windows 2023-03-25 Metapackage for packages which provide BLAS
lapack-reference:x64-windows 3.11.0#1 LAPACK - Linear Algebra PACKage
lapack-reference[blas-select]:x64-windows Use external optimized BLAS
lapack-reference[noblas]:x64-windows Use external optimized BLAS
lapack:x64-windows 2022-02-22#2 Metapackage for packages which provide LAPACK
openblas:x64-windows 0.3.25 OpenBLAS is an optimized BLAS library based on G...
sqlite3:x64-windows 3.43.2 SQLite is a software library that implements a s...
sqlite3[json1]:x64-windows Enable JSON functionality for sqlite3
vcpkg-cmake-config:x64-windows 2022-02-06#1
vcpkg-cmake:x64-windows 2023-05-04
vcpkg-gfortran:x64-windows 3#3 Metaport to install gfortran dependencies from m...

Compile error: no match for ‘operator=’ (operand types are ‘dlib::te::storage_heap’ and ‘std::vector<dlib::rectangle>’)

To use a system-wide dependency:

cargo build
dlib/any/storage.h:141:24: error: no match for ‘operator=’ (operand types are ‘dlib::te::storage_heap’ and ‘std::vector<dlib::rectangle>’)
  cargo:warning=  141 |                     me = T{};
  cargo:warning=      |                     ~~~^~~~~
  cargo:warning=/mnt/e/work/gitwork/dlib/dlib/any/storage.h:237:27: note: candidate: ‘dlib::te::storage_heap& dlib::te::storage_heap::operator=(const dlib::te::storage_heap&)’
  cargo:warning=  237 |             storage_heap& operator=(const storage_heap& other)
  cargo:warning=      |                           ^~~~~~~~
  cargo:warning=/mnt/e/work/gitwork/dlib/dlib/any/storage.h:237:57: note:   no known conversion for argument 1 from ‘std::vector<dlib::rectangle>’ to ‘const dlib::te::storage_heap&’
  cargo:warning=  237 |             storage_heap& operator=(const storage_heap& other)
  cargo:warning=      |                                     ~~~~~~~~~~~~~~~~~~~~^~~~~
  cargo:warning=/mnt/e/work/gitwork/dlib/dlib/any/storage.h:265:27: note: candidate: ‘dlib::te::storage_heap& dlib::te::storage_heap::operator=(dlib::te::storage_heap&&)’
  cargo:warning=  265 |             storage_heap& operator=(storage_heap&& other) noexcept
  cargo:warning=      |                           ^~~~~~~~
  cargo:warning=/mnt/e/work/gitwork/dlib/dlib/any/storage.h:265:52: note:   no known conversion for argument 1 from ‘std::vector<dlib::rectangle>’ to ‘dlib::te::storage_heap&&’
  cargo:warning=  265 |             storage_heap& operator=(storage_heap&& other) noexcept
  cargo:warning=      |                                     ~~~~~~~~~~~~~~~^~~~~
  exit status: 1

  --- stderr


  error occurred: ToolExecError: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "/mnt/e/work/gitwork/dlib-face-recognition" "-Wall" "-Wextra" "-std=c++11" "-o" "/mnt/e/work/gitwork/dlib-face-recognition/target/debug/build/dlib-face-recognition-ac2c3cd8fc46fdc7/out/f6bb29e82649de1e-cpp_closures.o" "-c" "/mnt/e/work/gitwork/dlib-face-recognition/target/debug/build/dlib-face-recognition-ac2c3cd8fc46fdc7/out/rust_cpp/cpp_closures.cpp" with args "c++" did not execute successfully (status code exit status: 1).

Linking issue on Windows 11

I've tried to use this lib on my project, yet cargo cannot build it with build-native, embed-all and openblas features and give the following error:

openblas.txt

When I try it without openblas feature it gives this error:

blas.txt

Lapack, blas and openblas are installed using vcpkg and I have cmake on my machine. Also changes on github doesn't seem to get uploaded to crates.io, since I had to manually change the file that is changed on #20.

failed to run custom build command for `dlib-face-recognition v0.3.0` on Fedora 38

I'm getting the error above when trying to build using cargo on Fedora 38 with g++ 13.

The failure seems to be due to a number of ... function uses ‘auto’ type specifier without trailing return type errors. (I'm attaching the output of cargo build 2> error.log).

According to StackOverflow (https://stackoverflow.com/questions/44798728/warning-function-uses-auto-type-specifier-without-trailing-return-type), that code can only be compiled with C++14. I've noticed that the latest release of gcc is version 13, so I wonder how can this code be compiled at all.

Any help is greatly appreciated.

Thanks

error.log

Cargo build failures on LXQt

Hello, I want to try learning from this project and running the example, but I encountered a few issues. I have ensured that I have installed CMake, g++, and c++, and my versions are as follows. The build process of dlib should be without any issues, but I don't know why the wrapper.rs file is unable to link with the header files referenced from the target build folder. Could you please give me some tips or ideas on how to solve these issues?

cmake --version

$ cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

c++ --version

$ c++ --version
c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ --version

$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Cargo build errors

$ sudo cargo build
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /tester/dlib-face-recognition/sys/Cargo.toml
workspace: /tester/dlib-face-recognition/Cargo.toml
   Compiling dlib-face-recognition v0.3.2 (/tester/dlib-face-recognition)
The following warnings were emitted during compilation:

warning: src/wrapper.rs:2:14: fatal error: dlib/dnn.h: No such file or directory
warning:     2 |     #include <dlib/dnn.h>
warning:       |              ^~~~~~~~~~~~
warning: compilation terminated.

error: failed to run custom build command for `dlib-face-recognition v0.3.2 (/tester/dlib-face-recognition)`

Caused by:
  process didn't exit successfully: `/tester/dlib-face-recognition/target/debug/build/dlib-face-recognition-605abc5d9bdaa42a/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=./files
  cargo:rustc-link-lib=blas
  cargo:rustc-link-lib=dlib
  cargo:rustc-link-lib=lapack
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CXX_x86_64-unknown-linux-gnu
  CXX_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_unknown_linux_gnu
  CXX_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-unknown-linux-gnu
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_unknown_linux_gnu
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "/tester/dlib-face-recognition" "-Wall" "-Wextra" "-std=c++14" "-o" "/tester/dlib-face-recognition/target/debug/build/dlib-face-recognition-d626b80a744e4d5a/out/1050f4fc78588567-cpp_closures.o" "-c" "/tester/dlib-face-recognition/target/debug/build/dlib-face-recognition-d626b80a744e4d5a/out/rust_cpp/cpp_closures.cpp"
  cargo:warning=src/wrapper.rs:2:14: fatal error: dlib/dnn.h: No such file or directory

  cargo:warning=    2 |     #include <dlib/dnn.h>

  cargo:warning=      |              ^~~~~~~~~~~~

  cargo:warning=compilation terminated.

  exit status: 1

  --- stderr


  error occurred: ToolExecError: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "/tester/dlib-face-recognition" "-Wall" "-Wextra" "-std=c++14" "-o" "/tester/dlib-face-recognition/target/debug/build/dlib-face-recognition-d626b80a744e4d5a/out/1050f4fc78588567-cpp_closures.o" "-c" "/tester/dlib-face-recognition/target/debug/build/dlib-face-recognition-d626b80a744e4d5a/out/rust_cpp/cpp_closures.cpp" with args "c++" did not execute successfully (status code exit status: 1).

It works on Arch Linux

I tried to run the draw example with the build-native feature. It didn't work initially even when I had blas. I installed the extra/openblas package but it still didn't work. It worked perfectly after I installed extra/blas-openblas

Using this async

Would you be able to provide an async example for face recognition from video streams using something like tokio?

FaceLandmarks is private

dlib_face_recognition::landmark_prediction::landmarks::FaceLandmarks Is private and therefore the following code snippet won't compile.

use dlib_face_recognition::*;

fn get_landmarks(image_matrix: &ImageMatrix, rect: &Rectangle) -> FaceLandmarks {
    // doing stuff....
}

Also, thanks for all the work on the library!

undefined reference to `typeinfo for tbb::task'

I am currently using ubuntu 22.10.

Thank in advance for any help

  /usr/bin/ld: CMakeFiles/dnn_instance_segmentation_train_ex.dir/dnn_instance_segmentation_train_ex.cpp.o:(.data.rel.ro._ZTVN3tbb10interface98internal9flag_taskE[_ZTVN3tbb10interface98internal9flag_taskE]+0x28): undefined reference to `tbb::task::note_affinity(unsigned short)'
  /usr/bin/ld: CMakeFiles/dnn_instance_segmentation_train_ex.dir/dnn_instance_segmentation_train_ex.cpp.o:(.data.rel.ro._ZTIN3tbb10interface98internal9start_forINS_13blocked_rangeIN9__gnu_cxx17__normal_iteratorIPK10image_infoSt6vectorIS6_SaIS6_EEEEEEN6__pstl13__tbb_backend19__parallel_for_bodyISC_ZZNSE_10__internal15__pattern_walk2IRKNSE_9execution2v115parallel_policyESC_NS5_IPS9_I14truth_instanceSaISO_EES9_ISQ_SaISQ_EEEEZSt9transformISN_SC_SU_PFSQ_RS7_EENSt9enable_ifIXsrNSK_19is_execution_policyINSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEE5valueET1_E4typeEOS13_T0_S1D_S19_T2_EUlSW_RSQ_E_St17integral_constantIbLb0EEEES19_S1C_S1D_S1D_S19_S1E_T3_S1H_IbLb1EEENKUlvE_clEvEUlSC_SC_E_EEKNS_16auto_partitionerEEE[_ZTIN3tbb10interface98internal9start_forINS_13blocked_rangeIN9__gnu_cxx17__normal_iteratorIPK10image_infoSt6vectorIS6_SaIS6_EEEEEEN6__pstl13__tbb_backend19__parallel_for_bodyISC_ZZNSE_10__internal15__pattern_walk2IRKNSE_9execution2v115parallel_policyESC_NS5_IPS9_I14truth_instanceSaISO_EES9_ISQ_SaISQ_EEEEZSt9transformISN_SC_SU_PFSQ_RS7_EENSt9enable_ifIXsrNSK_19is_execution_policyINSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEE5valueET1_E4typeEOS13_T0_S1D_S19_T2_EUlSW_RSQ_E_St17integral_constantIbLb0EEEES19_S1C_S1D_S1D_S19_S1E_T3_S1H_IbLb1EEENKUlvE_clEvEUlSC_SC_E_EEKNS_16auto_partitionerEEE]+0x10): undefined reference to `typeinfo for tbb::task'
  /usr/bin/ld: CMakeFiles/dnn_instance_segmentation_train_ex.dir/dnn_instance_segmentation_train_ex.cpp.o:(.data.rel.ro._ZTIN3tbb10interface98internal9flag_taskE[_ZTIN3tbb10interface98internal9flag_taskE]+0x10): undefined reference to `typeinfo for tbb::task'
  collect2: error: ld returned 1 exit status
  gmake[2]: *** [CMakeFiles/dnn_instance_segmentation_train_ex.dir/build.make:116: dnn_instance_segmentation_train_ex] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:802: CMakeFiles/dnn_instance_segmentation_train_ex.dir/all] Error 2
  gmake[1]: *** Waiting for unfinished jobs....
  gmake: *** [Makefile:91: all] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

Cannot build on Tauri project

Hello, I am currently working on a Tauri project that needs to use face recognition. I have python code for such functionality, however i need to rewrite the code in rust to make it work on my desktop app. I added the crate to the cargo.toml, I have all the mentioned prerequisites in my machine. I already installed cmake (version 3.29.2) and dlib (installed through vcpkg). When I try to build the program it gives the following error:

2024-05-06T09:57:56.219326Z ERROR rust_analyzer::main_loop: FetchBuildDataError:
The following warnings were emitted during compilation:


error: failed to run custom build command for `dlib-face-recognition v0.3.2`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-2512533d306bcbe8\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=./files
  cargo:rustc-flags=-L C:\Users\vural\.cargo\registry\src\index.crates.io-6f17d22bba15001f\dlib-face-recognition-0.3.2\external-libs\windows
  cargo:rustc-link-lib=blas
  cargo:rustc-link-lib=lapack
  cargo:rustc-link-lib=static=dlib
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
  cpp_closures.cpp
  src\wrapper.rs(2): fatal error C1083: Cannot open include file: 'dlib/dnn.h': No such file or directory

  --- stderr


  error occurred: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "C:\\Users\\vural\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\dlib-face-recognition-0.3.2" "-W4" "-std=c++14" "-FoC:\\Users\\vural\\OneDrive\\Masaüstü\\New folder\\programming\\binance_webapp\\Zentrads v2\\src-tauri\\target\\debug\\build\\dlib-face-recognition-66c5a8f8eedbfbb1\\out\\00fe3d72988c521e-cpp_closures.o" "-c" "C:\\Users\\vural\\OneDrive\\Masaüstü\\New folder\\programming\\binance_webapp\\Zentrads v2\\src-tauri\\target\\debug\\build\\dlib-face-recognition-66c5a8f8eedbfbb1\\out\\rust_cpp\\cpp_closures.cpp" with args "cl.exe" did not execute successfully (status code exit code: 2).

However, when I try to build it using "build-native" feature, it gives the following error:

2024-05-06T10:32:15.800700Z ERROR flycheck: Flycheck failed to run the following command: CommandHandle { program: "C:\\Users\\vural\\.cargo\\bin\\cargo.exe", arguments: ["check", "--workspace", "--message-format=json-diagnostic-rendered-ansi", "--manifest-path", "C:\\Users\\path\\to\\the\\project\\src-tauri\\Cargo.toml", "--all-targets"], current_dir: Some("C:\\Users\\path\\to\\the\\project\\src-tauri") }, error=Cargo watcher failed, the command produced no valid metadata (exit code: ExitStatus(ExitStatus(101))):
   Compiling dlib-face-recognition-sys v19.24.0-rc.1
error: failed to run custom build command for `dlib-face-recognition-sys v19.24.0-rc.1`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-909d0eb2232a950f\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\path\\to\\the\\project\\src-tauri\\target\\debug\\build\\dlib-face-recognition-sys-11dfa1846fdb6b9f\\out\\dlib-19.24" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DCMAKE_INSTALL_PREFIX=install" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug"
  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
  -- Configuring incomplete, errors occurred!

  --- stderr
  Already got 'C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\dlib-19.24'
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:3 (project):
    Failed to run MSBuild command:

      C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe

    to get the value of VCTargetsPath:

      MSBuild version 17.9.8+b34f75857 for .NET Framework
      Build started 5/6/2024 1:32:15 PM.
      
      Project "C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj" on node 1 (default targets).
      PrepareForBuild:
        Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
      InitializeBuildStatus:
        Touching "VCTargetsPath\x64\Debug\VCTargetsPath.tlog\unsuccessfulbuild".
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018: The "GetOutOfDateItems" task failed unexpectedly. [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018: System.InvalidOperationException: The item metadata "%(FullPath)" cannot be applied to the path "VCTargetsPath\x64\Debug\VCTargetsPath.tlog\ParallelCustomBuild.command.1.tlog". Path: VCTargetsPath\x64\Debug\VCTargetsPath.tlog\ParallelCustomBuild.command.1.tlog exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Shared.FileUtilities.ItemSpecModifiers.GetItemSpecModifier(String currentDirectory, String itemSpec, String definingProjectEscaped, String modifier, String& fullPath) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Utilities.TaskItem.Microsoft.Build.Framework.ITaskItem2.GetMetadataValueEscaped(String metadataName) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Utilities.TaskItem.GetMetadata(String metadataName) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.CPPTasks.GetOutOfDateItems.Execute() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      Done Building Project "C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
      
      Build FAILED.
      
      "C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj" (default target) (1) ->
      (CustomBuild target) -> 
        C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018: The "GetOutOfDateItems" task failed unexpectedly. [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018: System.InvalidOperationException: The item metadata "%(FullPath)" cannot be applied to the path "VCTargetsPath\x64\Debug\VCTargetsPath.tlog\ParallelCustomBuild.command.1.tlog". Path: VCTargetsPath\x64\Debug\VCTargetsPath.tlog\ParallelCustomBuild.command.1.tlog exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Shared.FileUtilities.ItemSpecModifiers.GetItemSpecModifier(String currentDirectory, String itemSpec, String definingProjectEscaped, String modifier, String& fullPath) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Utilities.TaskItem.Microsoft.Build.Framework.ITaskItem2.GetMetadataValueEscaped(String metadataName) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.Utilities.TaskItem.GetMetadata(String metadataName) [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.CPPTasks.GetOutOfDateItems.Execute() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(203,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\Users\path\to\the\project\src-tauri\target\debug\build\dlib-face-recognition-sys-11dfa1846fdb6b9f\out\build\CMakeFiles\3.29.2\VCTargetsPath.vcxproj]
      
          0 Warning(s)
          1 Error(s)
      
      Time Elapsed 00:00:00.25
      

    Exit code: 1



  thread 'main' panicked at C:\Users\vural\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5:

  command did not execute successfully, got: exit code: 1

  build script failed, must exit now
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library\std\src\panicking.rs:647
     1: core::panicking::panic_fmt
               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library\core\src\panicking.rs:72
     2: cmake::find_exe::{{closure}}
     3: <cmake::Version as core::default::Default>::default
     4: cmake::Config::build
     5: byteorder::io::ReadBytesExt::read_u64
     6: byteorder::io::ReadBytesExt::read_u64
     7: core::ops::function::FnOnce::call_once{{vtable.shim}}
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I would really appreciate any help. Thanks.

dlib is not thread safe

Trying to speed up predictions by using rayon causes a core dump within dlib's allocator, some of the structures should be marked as either !Sync or !Send (or both).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.