dlib

python dlib 人脸检测

匿名 (未验证) 提交于 2019-12-02 22:51:30
1. anaconda 安装dlib库: 安装命令: https://anaconda.org/conda-forge/dlib 打开Anaconda Prompt:输入 conda install -c conda-forge dlib=19.9 等待安装完成即可; 2. 测试示例 方法1:基于Hog-SVM人脸检测器 方法2:基于深度卷积神经网络实现的人脸检测 # -*- coding: utf-8 -*- """ Created on Mon Jun 17 16:51:46 2019 @author: zfjuan """ import cv2 import dlib img = cv2.imread('.\\image\\keliamoniz1.jpg'); ''' #方法1: # 使用 Dlib 的正面人脸检测器 frontal_face_detector detector = dlib.get_frontal_face_detector() # 使用 detector 检测器来检测图像中的人脸 # use detector of Dlib to detector faces faces = detector(img, 1) print("人脸数 / Faces in all: ", len(faces)) # Traversal every face for i, d

Windows安装Python的CMake+dlib+Face_Recognition

匿名 (未验证) 提交于 2019-12-02 22:11:45
参考 https://cloud.tencent.com/developer/news/397617 1. 环境 Win10,Python 3.7.3 2. 安装Visual Studio CMake库依赖VS IDE,所以先安装VS IDE 下载地址: https://visualstudio.microsoft.com/zh-hans/vs/ 还有要注意的,就是在工作负载中, 一定要把这两个选上 ,不然还是会报错。 重点来了!!! 参考 https://stackoverflow.com/questions/41912372/dlib-installation-on-windows-10/49538054#49538054 18楼的链接 https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15# 安装了VS2017 勾选Visual C++ tools for CMake and Linux,右边显示会有4个包需要安装 这个包安装之后,安装dlib的时候才不会报错。 安装过程有点刺激,CPU占用100%,内存占用2个G。。。 3. 安装CMake pip install cmake 4. 环境变量 #原博写的是初次安装的教程

linux下dlib安装

匿名 (未验证) 提交于 2019-12-02 21:56:30
背景:工作需要在linux环境下安装dlib,conda安装完成后再pip里面找不到dlib,所以导包失败,因此尝试用dlib的源码安装 1、源码下载: 网址: https://pypi.org/simple/dlib/ 我的是python3.6.6,试了不少次才发现19.15.0可以使用,python3.7可以用19.17.0 2、下载完成后解压,安装 python setup.py install 可能遇到的问题: 1、 AttributeError: Module Pip has no attribute ' main ' 原因:版本不对,比如我之前用19.8.1版本就不可以,具体原因没有深究 2、 Cannot find appropriate C compiler on this system. 解决:缺少gcc, suao apt install gcc 3、 Compile error: Cannot find a C++ compiler that supports both C++ 11 and the specified C++ flags 解决: sudo apt-get install g++ 4、 Cannot find appropriate Makefile processor on this system 解决:缺少make, sudo apt

Mac/linux/windows7安装anaconda+tensorflow+opencv+dlib+face_recognition

三世轮回 提交于 2019-12-02 21:16:56
无论是mac还是linux/windows都需要确定系统是多少位的。主要就mac讲解。 确定服务器是32位的还是64位的(linux/mac)windows查看电脑信息就可以了 file /bin/ls 看到输出的内容即为服务器的位数,我的是64位的,故选择64位的anaconda。 Anaconda 下载anaconda anaconda ,选择自己对应的版本 进入Anaconda所在的目录,执行下面的命令: bash Anaconda3-5.0.1-Linux-x86.sh 此后依照提示操作即可(最简便的方式就是,让ENTER就ENTER,问yes或no,输入yes,三个yes分别代表同意license、使用默认的安装路径、自动向.bashrc写入路径) 4. 使.bashrc生效 此时Anaconda并未安装完成,若在终端输入python将会发现依然是Centos自带的python版本,这是因为.bashrc的更新还没有生效,执行下述命令使其生效即可。 source ~/.bashrc tensorflow 建立一个Tensorflow的运行环境 //目前Mac上的Tensorflow仅仅支持CPU版本,而且3.0以上版本仅支持3.5版本,所以创建环境的时候一定要加上Python=3.5。 // 创建环境 $ conda create -n tensorflow python

ubuntu16.04和ubuntu18.04安装dlib

自古美人都是妖i 提交于 2019-12-02 19:05:07
- # for macOS brew install cmake brew install boost brew install boost-python --with-python3 # for Ubuntu 16.04 sudo apt-get install build-essential cmake sudo apt-get install libgtk-3-dev sudo apt-get install libboost-all-dev # 安装 dlib pip install dlib git clone https://github.com/davisking/dlib.git cd dlib mkdir build && cd build && cmake .. && make -j8 sudo make install sudo apt-get -y install libopenblas-dev cd .. sudo python setup.py install --yes USE_AVX_INSTRUCTIONS - 来源: https://www.cnblogs.com/Ph-one/p/11759231.html

VSCode v1.35 - RuntimeError: CMake must be installed to build the following extensions: dlib

走远了吗. 提交于 2019-12-02 16:16:35
问题 I have already installed CMake by pip install cmake in my VS Code 1.35 and trying to install face_recognition but it still give me a RuntimeError. I'm using 'Python 3.7.3, x32' I also tried to install the dlib by pip install dlib since it is one of the reason why I can't install face_recognition . C:\Users\user>python -m pip install cmake Requirement already satisfied: cmake in c:\users\user\appdata\roaming\python\python37\site-packages (3.14.4) C:\Users\user>python -m pip install dlib

VSCode v1.35 - RuntimeError: CMake must be installed to build the following extensions: dlib

半世苍凉 提交于 2019-12-02 09:32:46
I have already installed CMake by pip install cmake in my VS Code 1.35 and trying to install face_recognition but it still give me a RuntimeError. I'm using 'Python 3.7.3, x32' I also tried to install the dlib by pip install dlib since it is one of the reason why I can't install face_recognition . C:\Users\user>python -m pip install cmake Requirement already satisfied: cmake in c:\users\user\appdata\roaming\python\python37\site-packages (3.14.4) C:\Users\user>python -m pip install dlib Collecting dlib Using cached https://files.pythonhosted.org/packages/05/57

Windows安装face_recognition库

可紊 提交于 2019-12-02 02:06:59
写在前面: 在pip官网搜face_recognition https://pypi.org/project/face_recognition/ 介绍中可看出该包更适合在Linux系统中使用,但也附上了在Windows系统中安装的须知: https://github.com/ageitgey/face_recognition/issues/175#issue-257710508 另外其他几个参考链接: https://blog.csdn.net/wyc12306/article/details/79286361 https://blog.csdn.net/Im1smb/article/details/78073563#t6 https://my.oschina.net/u/2428854/blog/1797473 https://www.jianshu.com/p/eb4bec6459c7 结合自己实际操作的过程,总结如下: 必须: 安装了C/C++ 编译器的Microsoft Visual Studio 2015 问题① Boost 库,V1.63或者更新的版本 问题② Python3 CMake,Windows安装时要将其路径加入环境变量 问题③ face_recognition一般要配合OpenCV使用,附上手动安装OpenCV包的教程: http://www.ywlib

how to convert a matrix in dlib to a std::vector

依然范特西╮ 提交于 2019-12-02 01:16:29
问题 I have a colume vector defined in dlib. How can I convert it to std::vector? typedef dlib::matrix<double,0,1> column_vector; column_vector starting_point(4); starting_point = 1,2,3,4; std::vector x = ?? Thanks 回答1: There are many ways. You could copy it via a for loop. Or use the std::vector constructor that takes iterators: std::vector<double> x(starting_point.begin(), starting_point.end()) . 回答2: This would be the way you normally iterate over the matrix (doesn't matter if the matrix has

Relocation R_X86_64_32S against '_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC

血红的双手。 提交于 2019-12-01 15:28:13
I'm trying to install the dlib Python library. On some systems (macOS, stock Ubuntu 14.04) pip install dlib works fine, but in the Ubuntu 14.x that's part of our CircleCI environment it fails with the following error. Linking CXX shared library dlib.so /usr/bin/ld: /opt/circleci/python/2.7.11/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against '_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC error: cmake build failed! What could be wrong? domkck The problem was that Python needs to be compiled with the --enable-shared flag for the dlib