本文首发于个人博客https://kezunlin.me/post/654a6d04/,欢迎阅读!

compile dlib on windows 10

Series

Guide

compile

git clone https://github.com/davisking/dlib.git
cd dlib && mkdir build && cd build
cmake-gui ..

with options

CMAKE_INSTALL_PREFIX  C:/Program Files/dlib

configure and compile with Visual Studio 2015 and install to C:/Program Files/dlib.

By default, dlib19.10.0_release_64bit_msvc1900.lib will be generated.

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.12)
# Every project needs a name. We call this the "examples" project.
project(examples) # Tell cmake we will need dlib. This command will pull in dlib and compile it
# into your project. Note that you don't need to compile or install dlib. All
# cmake needs is the dlib source code folder and it will take care of everything.
add_subdirectory(../dlib dlib_build) add_executable(demo demo.cpp)
target_link_libraries(demo dlib::dlib)

or

find_package(dlib REQUIRED)

if(MSVC)
set(dlib_LIBRARIES "C:/Program Files/dlib/lib/dlib.lib") # replace dlib::dlib
else()
endif(MSVC)
# ${dlib_INCLUDE_DIRS} and ${dlib_LIBRARIES} are deprecated, simply use target_link_libraries(your_app dlib::dlib)
MESSAGE( [Main] " dlib_INCLUDE_DIRS = ${dlib_INCLUDE_DIRS}")
MESSAGE( [Main] " dlib_LIBRARIES = ${dlib_LIBRARIES}") add_executable(demo demo.cpp)
#target_link_libraries(demo ${dlib_LIBRARIES})
target_link_libraries(demo dlib::dlib)

dlib for python api

cd tools/python
mkdir build && cd build
cmake-gui ..

compile dlib_python with Visual Studio 2015 and dlib.pyd will be generated.

copy dlib.pyd to C:\Python27\Lib\site-packages.

test dlib for python

import dlib
dir(dlib)

Reference

History

  • 20180330: created.

Copyright

windows 10上源码编译dlib教程 | compile dlib on windows 10的更多相关文章

  1. windows 10 上源码编译OpenCV并支持CUDA | compile opencv with CUDA support on windows 10

    本文首发于个人博客https://kezunlin.me/post/6580691f/,欢迎阅读! compile opencv with CUDA support on windows 10 Ser ...

  2. windows 10 上源码编译opengv | compile opengv on windows 10 from source

    本文首发于个人博客https://kezunlin.me/post/51cd9fa0/,欢迎阅读! compile opengv on windows 10 from source Series co ...

  3. [Part 4] 在Windows 10上源码编译PCL 1.8.1支持VTK和QT,可视化三维点云

    本文首发于个人博客https://kezunlin.me/post/2d809f92/,欢迎阅读! Part-4: Compile pcl with vtk qt5 support from sour ...

  4. [Windows篇] 在windows 10上源码编译gtest 并编写CMakeLists.txt

    本文首发于个人博客https://kezunlin.me/post/aca50ff8/,欢迎阅读! compile gtest on windows 10 Guide compile gtest on ...

  5. windows 10上源码编译libjpeg-turbo和使用教程 | compile and use libjpeg-turbo on windows 10

    本文首发于个人博客https://kezunlin.me/post/83828674/,欢迎阅读! compile and use libjpeg-turbo on windows 10 Series ...

  6. windows 10 上源码编译boost 1.66.0 | compile boost 1.66.0 from source on windows 10

    本文首发于个人博客https://kezunlin.me/post/854071ac/,欢迎阅读! compile boost 1.66.0 from source on windows 10 Ser ...

  7. Windows 10上源码编译glog和gflags 编写glog-config.cmake和gflags-config.cmake | compile glog and glags on windows from source

    本文首发于个人博客https://kezunlin.me/post/bb64e398/,欢迎阅读! compile glog v0.3.5 and glags on windows from sour ...

  8. Windows 10上源码编译Poco并编写httpserver和tcpserver | compile and install poco cpp library on windows

    本文首发于个人博客https://kezunlin.me/post/9587bb47/,欢迎阅读! compile and install poco cpp library on windows Se ...

  9. ubuntu 16.04源码编译OpenCV教程 | compile opencv on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/15f5c3e8/,欢迎阅读! compile opencv on ubuntu 16.04 Series Part 1: comp ...

随机推荐

  1. 玩转OneNET物联网平台之MQTT服务⑤ —— OneNet智能灯+MVP框架

    授人以鱼不如授人以渔,目的不是为了教会你具体项目开发,而是学会学习的能力.希望大家分享给你周边需要的朋友或者同学,说不定大神成长之路有博哥的奠基石... QQ技术互动交流群:ESP8266&3 ...

  2. 微信小程序开发注意事项(优化项)

    最近公司有一个小程序开发项目,自己也自学了不少,有一些开发小心得,记录在这里. 小程序开发中注意: 1,setData 小程序视图层和逻辑层在两个独立的模块,并不具备数据直接传递的,setData相当 ...

  3. 使用 Django 项目中的 ORM 编写伪造测试数据脚本

    作者:HelloGitHub-追梦人物 文中所涉及的示例代码,已同步更新到 HelloGitHub-Team 仓库 为了防止博客首页展示的文章过多以及提升加载速度,可以对文章列表进行分页展示.不过这需 ...

  4. (JavaScript) base64 字符串 和 ArrayBuffer 之间转换

    base64 --> ArrayBuffer function base64ToUint8Array(base64String) { const padding = '='.repeat((4 ...

  5. Go服务监控

    使用Golang可以开发出高性能的HTTP.GRPC服务.一般项目运行后,我们也需要监控服务的性能或者进行调试.除了打日志,还有没有其他可视化的方案呢?答案是有的. 本文将会介绍几种常用的监控方案. ...

  6. Kubernetes5-集群上搭建基于redis和docker的留言薄

    一.简介 1.环境依旧是kubernetes之前文章的架构 2.需要docker的镜像 1)php-forntend web 前端镜像 docker.io-kubeguide-guestbook-ph ...

  7. PTA刷题记录(3)

    团队天梯赛-------(3)分值:15 给定一个 k 位整数 N=d​k−1​​10​k−1​​+⋯+d​1​​10​1​​+d​0​​ (0≤d​i​​≤9, i=0,⋯,k−1, d​k−1​​ ...

  8. css3 transform做动画

    css3 transform做动画第一种用关键帧 这里就不说了 就说第二种方法用 transition属性 ps:1jquery anim不支持transform动画 但css还是支. 2 css3关 ...

  9. vue cli3.0^版本处理文件下载的问题

    downloadFile(url, fileName) { axios.get(url, { responseType: 'blob' }) .then(({ data }) => { // 为 ...

  10. vue的相关知识

    一.DOM vs 函数库 vs框架 DOM:  API繁琐 函数库:JQuery对DOM的每个步骤的API进行一对一的简化,但并没有改变DOM做事的步骤和方法. 框架:一个包含部分已经实现的功能的半成 ...