In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about the compilation and configuration of Dlib on VS2015. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
A brief introduction to Dlib
Dlib is a cross-platform general framework based on modern C++. The author is very powerful and diligent, and is always up to date. Recently, the author has been busy updating dnn, although I think the interface of dnn is very unfriendly. Dlib is very rich in content, including but not limited to machine learning, image processing, numerical algorithms, data compression and so on. More importantly, Dlib documents are very complete and examples are very rich.
The face detection provided by Dlib is more useful than the face detection model of OpenCV. And Dlib provides human face key point detection methods that OpenCV does not have (now, just appeared in the contrib module) and face recognition tools based on deep learning. And it provides more perfect machine learning and deep learning modules than OpenCV. And can be used in combination with OpenCV, the two images can be easily converted. I have tried a lot of face programs based on dlib: face detection, face key point extraction, face prediction, face changing algorithm and face recognition.
II. Compile Dlib
The method of compiling and installing dlib under Python has been introduced before, but calling dlib with Python requires compiling boost first. It's very troublesome. It's easier to use C++. But simple as it is, it may be more troublesome if you don't find the right tutorial. I found the way to configure dlib, Visual studio configuration dlib is too complex. To open a JPG or PNG image, you have to add the contents of three entire folders (including hundreds of files) to the project. I can't stand it. These are the following three. That's what most tutorials say. This method is also mentioned on the official website.
Dlib\ external\ libjpegdlib\ external\ libpngdlib\ external\ zlib
I don't know what people think, but I think it's anti-human. At that time, my habit was to ask du Niang when I encountered a problem, and then read some solutions in Chinese. Now the habit has gradually become to go to the official website and read the official documents. It was reconfigured according to the official documentation today. It feels a lot quicker. And using the command line of cmake is much better than GUI.
If you are interested, you can go to the official website to see the official tutorial: How to compile. Let me record my own configuration process here. It's about the same as the official introduction.
First of all, you need to have cmake and add it to the environment variable. If there is no camke in this step, you need to go to the official website. It is best to download the installation version rather than the compressed version, the installation version will let you choose whether or not to add environment variables, choose to add. Otherwise, those who download the compressed version will have to manually add environment variables and restart the computer before they can use it.
Then open the command prompt (shift plus right) under the dlib- version number folder (such as dlib-19.7), and use the following command, with slight changes relative to the official one:
Mkdir buildcd buildcmake-G "Visual Studio 14 2015 Win64".. cmake-- build. -- config Release
Here are two things to note.
(1) be sure to have vs 2015 or higher. It is said that the previous version does not have good support for Clipper 11.
(2) build must be in Release mode. Because Debug mode is super! super! Slow down! Test it yourself. Reference: Why is dlib slow?
After build completes, dlib.lib is generated under the\ dlib-19.7\ build\ dlib\ Release folder. The compilation is complete at this point. It's much easier than using cmake-gui!
3. Configure Dlib for Visual Studio
Configure visual studio 2015, create a new project, and name it dlib_01 here.
(1) Open the project properties, configure the containing directory, and directly above (the old image used in the current year):
(2) configure connector-input-additional dependencies:
(3) in order to open the jpg picture, you need to add DLIB_JPEG_SUPPORT, and the latter one is for acceleration. Similarly, if you want to open a png image, you have to add a DLIB_PNG_SUPPORT.
After the above three configurations are completed, you can write your own program or run the examples program that comes with dlib. But the official programs are run on the command line, if you want to run in vs need to modify slightly, change the command line parameters to a specific file name or path. An example of face detection and face key point detection is tried. It works all right.
The above is how Dlib compiles and configures on VS2015. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.