admin管理员组

文章数量:1794759

face

face

在linxu环境下实现了face_recognition的运行后(参考: ,切记勿按该文档的说明去安装PIXEL这个GUI,否则会灰屏卡死,然后重装)

1. 制作启动盘

1.1  下载镜像

/

最好下载一个带桌面的版本

1.2 烧录镜像

下载一个win32 disk imager 专门用来写“.img”

格式化 /  烧录

格式化软件可选:SD formatter

烧录软件可选:win32diskimager

烧录完成的tf卡已经在电脑上显示为boot了,拔出tf并插入树莓派板中,启动:

按提示 依次修改密码 / 选择一个wifi / 地区选择 / 软件升级

 

2. 配置

2.1 

(参考: ,切记勿按该文档的说明去安装PIXEL这个GUI,否则会灰屏卡死,然后重装)

通过上一步完成基本的配置后,开启一个terminal即可按步骤进行配置。

Install required libraries with these commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential \cmake \gfortran \git \wget \curl \graphicsmagick \libgraphicsmagick1-dev \libatlas-dev \libavcodec-dev \libavformat-dev \libboost-all-dev \libgtk2.0-dev \libjpeg-dev \liblapack-dev \libswscale-dev \pkg-config \python3-dev \python3-numpy \python3-pip \zip
sudo apt-get clean

Install the picamera python library with array support (if you are using a camera):

sudo apt-get install python3-picamera
sudo pip3 install --upgrade picamera[array]

Temporarily enable a larger swap file size (so the dlib compile won't fail due to limited memory):

sudo nano /etc/dphys-swapfile< change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=1024 and save / exit nano >sudo /etc/init.d/dphys-swapfile restart

Download and install dlib v19.6:

mkdir -p dlib
git clone -b 'v19.6' --single-branch .git dlib/
cd ./dlib
sudo python3 setup.py install --compiler-flags "-mfpu=neon"

Install face_recognition:

sudo pip3 install face_recognition

Revert the swap file size change now that dlib is installed:

sudo nano /etc/dphys-swapfile< change CONF_SWAPSIZE=1024 to CONF_SWAPSIZE=100 and save / exit nano >sudo /etc/init.d/dphys-swapfile restart

Download the face recognition code examples:

git clone --single-branch .git
cd ./face_recognition/examples
python3 facerec_on_raspberry_pi.py

3.  远程控制

如果想使用远程桌面,有很多工具可选择,比如putty,在IP地址处输入树莓派的ip地址(该IP地址是:在在无线网络管理器处可查询到连接词此路由器的设备,并显示该设备的IP地址),一定要在开启树莓派的ssh使能, raspi-config  /  ingterfaces / ssh

4. opencv 安装

使用 以下指令安装,可能会不稳定,有时候安装不成功。 

sudo pip3 install opencv-python  (sudo pip install opencv-python)

pip3 install opencv-python

 

5. 可能遇到的问题

问题1: 连接网络

若连接公司的宽带网络,可能需要账号授权才能登陆,但是该raspberryPi系统不会弹出登陆页面,最好连接wifi网络,有两种设置方法,分别如下:

1)通过代码

扫描所有无线网络:sudo iwlist wlan0 sacn  

添加无线网络:sudo vim /etc/wpa_supplicant/wpa_supplicant.conf

添加如下代码,只是需要更改id号及相应密码即可

network={ssid="ssid_name"key_mgmt=WPA-PSKpsk="password"
}
2)通过命令:

sudo raspi-config  

依次选择网络选项/ WIFI/    然后输入wifi的id 及密码即可

 

问题2:libcblas.so.3: cannot open shared object file: No such file or directory

解决方法:

需要安装 libatlas-base-dev,命令如下:

sudo apt-get install libatlas-base-dev

参考:

 

问题3 :opencv安装

pip3 install opencv-python

 

问题4: 安装出错

若使用GIT命令克隆仓库时出现以下错误提示,很可能是网络不稳定导致的,可通过更换无线网络解决。(自己手机开的热点网络变得不稳定,后面在笔记本上用360开了个热点,问题解决)

fatal: The remote end hung up unexpectedly 
fatal: early EOF 
fatal: index-pack failed

问题5 : ImportError: libatlas.so.3: cannot open shared object file: no such file or derectory

解决方法:

需要安装 libatlas-base-dev,命令如下:

sudo apt-get install libatlas-base-dev

问题6:camera is not enabled ,try  running ......

通过sudo raspi-config   / enable   camera    未解决

搜了很多也没找到确切答案,不过可能的愿意是低电压、插错等

问题6: 运行程序 不显示图片及视频

安装imagemagick:   sudo apt-get install imagemagick

原因:因为我在Linux(openSUSE)中使用python,并没有安装pyhon默认的图像浏览器ImageMagick,所以图像浏览器无法启动(参考:       ,.html )

 

本文标签: face