├── README.md ├── camera ├── Video.py ├── VideoStream.py └── __init__.py ├── configure ├── __init__.py ├── config.py └── userManager.py ├── facerec ├── __init__.py ├── capturePositive.py ├── face.py ├── haarcascade_frontalface_alt.xml ├── haarcascade_frontalface_alt2.xml ├── negative │ ├── README │ ├── s1 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s10 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s11 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s12 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s13 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s14 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s15 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s16 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s17 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s18 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s19 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s2 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s20 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s21 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s22 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s23 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s24 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s25 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s26 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s27 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s28 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s29 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s3 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s30 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s31 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s32 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s33 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s34 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s35 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s36 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s37 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s38 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s39 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s4 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s40 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s5 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s6 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s7 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ ├── s8 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm │ └── s9 │ │ ├── 1.pgm │ │ ├── 10.pgm │ │ ├── 2.pgm │ │ ├── 3.pgm │ │ ├── 4.pgm │ │ ├── 5.pgm │ │ ├── 6.pgm │ │ ├── 7.pgm │ │ ├── 8.pgm │ │ └── 9.pgm ├── recognize.py ├── train.py └── training │ ├── training.xml │ └── users.csv ├── fingerec ├── __init__.py └── finger.py ├── main.py ├── res ├── images.jpg └── pic │ ├── button.png │ ├── delete_100x100.png │ ├── facerec.png │ ├── finger.png │ ├── right.png │ ├── scanbar.png │ └── wrong.png └── ui ├── __init__.py ├── css └── style.css ├── mainwindow.py ├── mainwindow.ui ├── pictureselect.py ├── soft_keyboard.py └── ui.py /README.md: -------------------------------------------------------------------------------- 1 | ## !该项目已停止维护! 2 | 3 | # facerec-python 4 | 5 | ## 个人毕业设计 - 基于树莓派、OpenCV及Python语言的人脸识别 6 | 7 | ### 简介 8 | 使用OpenCV for Python图像识别库,运行在树莓派RASPBIAN JESSIE Linux系统平台上,搭配树莓派官方摄像头模块。 9 | 10 | ### 运行要求 11 | 1. OpenCV 2.4.9 for Python 12 | 2. Python 2.7 13 | 3. v4l2 14 | 4. PyQt4 15 | 16 | ### 安装要求 17 | 18 | ```bash 19 | sudo apt-get install build-essential cmake pkg-config python-dev libgtk2.0-dev libgtk2.0 zlib1g-dev libpng-dev libjpeg-dev libtiff-dev libjasper-dev libavcodec-dev swig unzip 20 | ``` 21 | 22 |  1. 启用v4l2 23 | ```bash 24 | sudo nano /etc/modules 25 | # 增加一行记录 26 | bcm2835-v4l2 27 | # 重启后可以找到/dev/video0 28 | 29 | # 编译v4l2-util 30 | apt-get install autoconf gettext libtool libjpeg8 libjpeg8-dev 31 | git clone git://git.linuxtv.org/v4l-utils.git 32 | cd v4l-utils/ 33 | sudo ./bootstrap.sh 34 | ./configure 35 | make 36 | sudo make install 37 | ``` 38 | 39 |  2. 编译OpenCV 2.4.9 40 | 41 | ```bash 42 | wget https://jaist.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zip 43 | unzip opencv-2.4.9.zip 44 | cd opencv-2.4.9/ 45 | cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_ocl=OFF 46 | 47 | # 要使OpenCV开启对v4l2的支持 cmake之后要有以下输出 48 | # V4L/V4L2: Using libv4l (ver 1.13.0) 49 | 50 | sudo make 51 | sudo make install 52 | ``` 53 | 54 | 3. 安装PyQt4 55 | ```bash 56 | sudo apt-get install python-qt4 57 | ``` 58 | 59 | 4. 运行 60 | ```bash 61 | python main.py 62 | ``` 63 | 64 | ### 注意 65 | 66 | 该示例运行的屏幕分辨率为竖屏480 x 800,可以修改 /boot/config.txt 的以下配置 67 | 68 | [config.txt配置说明](https://www.raspberrypi.org/documentation/configuration/config-txt.md) 69 | ```bash 70 | hdmi_cvt=800 480 60 6 71 | hdmi_group=2 72 | hdmi_mode=87 73 | # 设置屏幕旋转角度 74 | display_rotate=3 75 | ``` 76 | -------------------------------------------------------------------------------- /camera/Video.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import cv2 3 | import numpy as np 4 | from PyQt4 import QtGui 5 | 6 | #封装cv2.VideoCapture函数,用于读取摄像头每帧图像的数据 7 | #可将每帧图像数据转化为QImage及CVImage 8 | class Video(): 9 | def __init__(self, device): 10 | self.capture = cv2.VideoCapture(device) 11 | self.currentFrame = np.array([]) 12 | self.readFrame = None 13 | self.is_release = False 14 | 15 | def setFrameSize(self, width, height): 16 | self.capture.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width) 17 | self.capture.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height) 18 | 19 | def setFPS(self, fps): 20 | self.capture.set(cv2.cv.CV_CAP_PROP_FPS, fps) 21 | 22 | def read(self): 23 | ret, self.readFrame = self.capture.read() 24 | if ret == True: 25 | return self.readFrame 26 | else: 27 | return None 28 | 29 | def open(self, device): 30 | self.is_release = False 31 | self.capture.open(device) 32 | 33 | def release(self): 34 | self.is_release = True 35 | self.capture.release() 36 | 37 | def captureNextFrame(self, isFlip = True): 38 | """ 39 | capture frame and reverse RBG BGR and return opencv image 40 | """ 41 | self.read() 42 | if self.readFrame != None: 43 | self.currentFrame = cv2.cvtColor(self.readFrame, cv2.COLOR_BGR2RGB) 44 | if isFlip == True: 45 | self.currentFrame = cv2.flip(self.currentFrame, 1) 46 | 47 | def convertFrame(self): 48 | """ 49 | converts frame to format suitable for QtGui 50 | """ 51 | try: 52 | height,width = self.currentFrame.shape[:2] 53 | img = QtGui.QImage(self.currentFrame, 54 | width, 55 | height, 56 | QtGui.QImage.Format_RGB888) 57 | return img 58 | except: 59 | return None 60 | 61 | def getFrame(self): 62 | readFrame = self.read() 63 | return readFrame 64 | 65 | def getQImageFrame(self): 66 | self.captureNextFrame() 67 | return self.convertFrame() 68 | 69 | def getCVImage(self, params): 70 | return cv2.cvtColor(self.readFrame, params) 71 | 72 | def getGrayCVImage(self, isFlip=True): 73 | if self.readFrame != None: 74 | grayFrame = cv2.cvtColor(self.readFrame, cv2.COLOR_BGR2GRAY) 75 | if isFlip == True: 76 | grayFrame = cv2.flip(grayFrame, 1) 77 | return grayFrame 78 | else: 79 | print 'readFrame is None' 80 | return None -------------------------------------------------------------------------------- /camera/VideoStream.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import threading 3 | import socket 4 | import numpy as np 5 | import cv2 6 | from _socket import timeout 7 | 8 | class VideoStream(threading.Thread): 9 | ''' 10 | ''' 11 | 12 | def __init__(self, video, host, port): 13 | ''' 14 | Constructor 15 | ''' 16 | super(VideoStream, self).__init__() 17 | 18 | self.video = video 19 | self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 20 | self.host = host 21 | self.port = port 22 | self.encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 95] 23 | 24 | self._stop = False 25 | 26 | def setEncodeParam(self, param): 27 | self.encode_param = param 28 | 29 | def setServer(self, host, port): 30 | self.host = host 31 | self.port = port 32 | 33 | def run(self): 34 | #self.s.connect((self.host, self.port)) 35 | self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 36 | self.s.settimeout(5) 37 | self.s.bind((self.host, self.port)) 38 | self.s.listen(True) 39 | 40 | connect, address = self.waitConnect() 41 | if connect is None: 42 | return 43 | print 'address:', address 44 | while not self.stoped(): 45 | try: 46 | frame = self.video.readFrame 47 | if frame != None: 48 | frame = cv2.flip(frame, 1) 49 | result, encodeImage = cv2.imencode('.jpg', frame, self.encode_param) 50 | data = np.array(encodeImage) 51 | stringData = data.tostring() 52 | 53 | connect.send(str(len(stringData)).ljust(16)) 54 | connect.send(stringData) 55 | except socket.error: 56 | connect.close() 57 | connect, address = self.waitConnect() 58 | if connect is None: 59 | return 60 | print 'address:', address 61 | self.s.close() 62 | print 'stream stop' 63 | #self.s.closeSocket() 64 | # data = np.array(frame) 65 | # stringData = data.totring() 66 | # self.s.send(str(len(stringData)).ljust(16)) 67 | # self.s.send(stringData) 68 | 69 | def waitConnect(self): 70 | connected = False 71 | connect, address = None, None 72 | while not connected and not self.stoped(): 73 | try: 74 | connect, address = self.s.accept() 75 | connected = True 76 | except timeout: 77 | None 78 | return connect, address 79 | 80 | def startStream(self): 81 | self.start() 82 | 83 | def stop(self): 84 | self._stop = True 85 | 86 | def stoped(self): 87 | return self._stop 88 | -------------------------------------------------------------------------------- /camera/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/camera/__init__.py -------------------------------------------------------------------------------- /configure/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/configure/__init__.py -------------------------------------------------------------------------------- /configure/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | #coding=utf-8 3 | # Threshold for the confidence of a recognized face before it's considered a 4 | # positive match. Confidence values below this threshold will be considered 5 | # a positive match because the lower the confidence value, or distance, the 6 | # more confident the algorithm is that the face was correctly detected. 7 | # Start with a value of 3000, but you might need to tweak this value down if 8 | # you're getting too many false positives (incorrectly recognized faces), or up 9 | # if too many false negatives (undetected faces). 10 | POSITIVE_THRESHOLD = 2000.0 11 | 12 | 13 | 14 | # Directories which contain the positive and negative training image data. 15 | POSITIVE_DIR = './training/positive' 16 | NEGATIVE_DIR = './training/negative' 17 | 18 | # Value for positive and negative labels passed to face recognition model. 19 | # Can be any integer values, but must be unique from each other. 20 | # You shouldn't have to change these values. 21 | POSITIVE_LABEL = 1 22 | NEGATIVE_LABEL = 2 23 | 24 | # Prefix for positive training image filenames. 25 | POSITIVE_FILE_PREFIX = 'positive_' 26 | 27 | # Size (in pixels) to resize images for training and prediction. 28 | # Don't change this unless you also change the size of the training images. 29 | FACE_WIDTH = 92 30 | FACE_HEIGHT = 112 31 | 32 | # base dir 33 | BASE_DIR = os.path.abspath('./') 34 | print BASE_DIR 35 | 36 | # Face detection cascade classifier configuration. 37 | # You don't need to modify this unless you know what you're doing. 38 | # See: http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html 39 | HAAR_FACES = 'haarcascade_frontalface_alt.xml' 40 | HAAR_SCALE_FACTOR = 1.3 41 | HAAR_MIN_NEIGHBORS = 4 42 | HAAR_MIN_SIZE = (30, 30) 43 | 44 | # Filename to use when saving the most recently captured image for debugging. 45 | DEBUG_IMAGE = 'capture.pgm' 46 | 47 | # Pin Number of Flash light 48 | FLASH_LIGHT_PIN = 40 49 | 50 | #Classifier file 51 | CLASSIFIER_FILE = BASE_DIR + '/facerec/haarcascade_frontalface_alt.xml' 52 | 53 | # Faces dir 54 | FACES_DIR = BASE_DIR + '/facerec/faces' 55 | 56 | #Training dir 57 | TRAINING_DIR = BASE_DIR + '/facerec/training' 58 | 59 | # File to save and load face recognizer model. 60 | TRAINING_FILE = TRAINING_DIR + '/training.xml' 61 | 62 | #user csv file 63 | USERS_CVS_FILE = BASE_DIR + '/facerec/training/users.csv' 64 | -------------------------------------------------------------------------------- /configure/userManager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2016年5月7日 4 | 5 | @author: imhey_000 6 | ''' 7 | 8 | import config 9 | import json 10 | import csv 11 | 12 | class UserManager(object): 13 | ''' 14 | classdocs 15 | ''' 16 | users = [] 17 | userIds = [] 18 | userNames = [] 19 | fieldNames = ['userName', 'id'] 20 | 21 | __CSVFile = config.USERS_CVS_FILE 22 | 23 | def __init__(self, csvFile=None): 24 | ''' 25 | Constructor 26 | ''' 27 | if csvFile != None: 28 | self.__CSVFile = csvFile 29 | 30 | def hasUser(self, user): 31 | if type(user) is str: 32 | userNames = self.getAllUserName() 33 | if userNames.__contains__(user): 34 | return True 35 | elif type(user) is int: 36 | userIds = self.getAllUserId() 37 | if userIds.__contains__(str(user)): 38 | return True 39 | 40 | return False 41 | 42 | def addUser(self, name): 43 | if self.hasUser(name): 44 | return False 45 | else: 46 | userIds = self.getAllUserId() 47 | if userIds == []: 48 | newId = 1 49 | else: 50 | userIds.sort() 51 | newId = int(userIds[len(userIds)-1]) + 1 52 | newUser = {'userName':name, 'id':str(newId)} 53 | self.users.append(newUser) 54 | 55 | self.__writeCSV(newUser) 56 | 57 | return newId 58 | 59 | # 60 | def changeUserName(self, old, new): 61 | if self.hasUser(old): 62 | userNames = self.getAllUserName() 63 | index = userNames.index(old) 64 | self.users[index]['userName'] = str(new) 65 | self.__writeCSV(self.users) 66 | return True 67 | else: 68 | return False 69 | 70 | def deleteUser(self, userName): 71 | if self.hasUser(userName): 72 | userNames = self.getAllUserName() 73 | index = userNames.index(userName) 74 | self.users.__delitem__(index) 75 | self.__writeCSV(self.users) 76 | return True 77 | else: 78 | return False 79 | # 80 | def setCSVFile(self, fileName): 81 | self.__CSVFile = fileName 82 | # 83 | def getUserByName(self, name): 84 | self.__readCSV() 85 | for user in self.users: 86 | if user['userName'] == name: 87 | return user 88 | # 89 | def getUserById(self, id): 90 | self.__readCSV() 91 | for user in self.users: 92 | if int(user['id']) == id: 93 | return user 94 | 95 | def getAllUser(self): 96 | self.__readCSV() 97 | return self.users 98 | # 99 | def getAllUserName(self): 100 | self.__readCSV() 101 | return self.userNames 102 | # 103 | def getAllUserId(self): 104 | self.__readCSV() 105 | return self.userIds 106 | 107 | def __readCSV(self): 108 | self.csvIn = open(self.__CSVFile, 'rb') 109 | self.reader = csv.DictReader(self.csvIn, self.fieldNames) 110 | self.users = [] 111 | self.userIds = [] 112 | self.userNames = [] 113 | for row in self.reader: 114 | self.users.append(row) 115 | self.userIds.append(row['id']) 116 | self.userNames.append(row['userName']) 117 | self.csvIn.close() 118 | 119 | def __writeCSV(self, data): 120 | if type(data) is list: 121 | self.csvOut = open(self.__CSVFile, 'wb') 122 | self.writer = csv.DictWriter(self.csvOut, self.fieldNames) 123 | print 'user update all' 124 | print data 125 | self.writer.writerows(data) 126 | self.csvOut.close() 127 | 128 | elif type(data) is dict: 129 | self.csvOut = open(self.__CSVFile, 'ab') 130 | self.writer = csv.DictWriter(self.csvOut, self.fieldNames) 131 | print 'user append' 132 | self.writer.writerow(data) 133 | self.csvOut .close() 134 | 135 | def __readJSON(self): 136 | self.jsonIn = open(self.__JSONFile, 'rb') 137 | self.users = json.loads(self.jsonIn.read()) 138 | 139 | def __writeJSON(self, data): 140 | if type(data) is list: 141 | self.jsonOut = open(self.__CSVFile, 'wb') 142 | 143 | elif type(data) is dict: 144 | #TODO 145 | pass -------------------------------------------------------------------------------- /facerec/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/__init__.py -------------------------------------------------------------------------------- /facerec/capturePositive.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | """Raspberry Pi Face Recognition Treasure Box 3 | Positive Image Capture Script 4 | Copyright 2013 Tony DiCola 5 | 6 | Run this script to capture positive images for training the face recognizer. 7 | """ 8 | import face 9 | from configure import config 10 | 11 | import cv2 12 | import os 13 | import sys 14 | import glob 15 | 16 | def capture(personName): 17 | # Set the directory of person 18 | PERSON_DIR = config.POSITIVE_DIR + '/' + personName 19 | # TODO get camera object 20 | camera = None 21 | # Create the directory for positive training images if it doesn't exist. 22 | if not os.path.exists(config.POSITIVE_DIR): 23 | os.mkdir(config.POSITIVE_DIR) 24 | if not os.path.exists(PERSON_DIR): 25 | os.mkdir(PERSON_DIR) 26 | # Find the largest ID of existing positive images. 27 | # Start new images after this ID value. 28 | files = sorted(glob.glob(os.path.join(PERSON_DIR, 29 | config.POSITIVE_FILE_PREFIX + personName + '_' + '[0-9][0-9][0-9].pgm'))) 30 | count = 0 31 | if len(files) > 0: 32 | # Grab the count from the last filename. 33 | # ex: 'positive_012.pgm' >> get 012 trans to int 12 34 | count = int(files[-1][-7:-4])+1 35 | 36 | image = camera.read() 37 | # Convert image to grayscale. 38 | image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) 39 | # Get coordinates of single face in captured image. 40 | result = face.detectSingleFace(image) 41 | if result is None: 42 | print 'Could not detect single face!' 43 | return 44 | x, y, w, h = result 45 | # Crop image as close as possible to desired face aspect ratio. 46 | # Might be smaller if face is near edge of image. 47 | crop = face.crop(image, x, y, w, h) 48 | # Save image to file. 49 | filename = os.path.join(PERSON_DIR, config.POSITIVE_FILE_PREFIX + personName + '_' + '%03d.pgm' % count) 50 | cv2.imwrite(filename, crop) 51 | 52 | -------------------------------------------------------------------------------- /facerec/face.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | import cv2 3 | 4 | from configure import config 5 | 6 | haar_faces = cv2.CascadeClassifier(config.CLASSIFIER_FILE) 7 | 8 | def detectSingleFace(image): 9 | """ 返回脸部区域的边界(x, y, width, height) 10 | 如果没有检测到人脸则返回None 11 | """ 12 | faces = haar_faces.detectMultiScale(image, 13 | scaleFactor=config.HAAR_SCALE_FACTOR, 14 | minNeighbors=config.HAAR_MIN_NEIGHBORS, 15 | minSize=config.HAAR_MIN_SIZE, 16 | flags=cv2.CASCADE_SCALE_IMAGE) 17 | #是否检测到人脸 18 | if len(faces) != 1: 19 | return None 20 | return faces[0] 21 | 22 | def crop(image, x, y, w, h): 23 | """ 24 | """ 25 | crop_height = int((config.FACE_HEIGHT / float(config.FACE_WIDTH)) * w) 26 | midy = y + h/2 27 | y1 = max(0, midy-crop_height/2) 28 | y2 = min(image.shape[0]-1, midy+crop_height/2) 29 | return image[y1:y2, x:x+w] 30 | 31 | def resize(image): 32 | """调整图像大小 92x112 以进行图像训练或人脸检测 33 | """ 34 | return cv2.resize(image, (config.FACE_WIDTH, config.FACE_HEIGHT), interpolation=cv2.INTER_LANCZOS4) 35 | 36 | def markFace(image): 37 | result = detectSingleFace(image) 38 | if result != None: 39 | x, y, w, h = result 40 | print result 41 | cv2.rectangle(image, (x, y), (x+w, y+h), (255,0,0)) 42 | return image -------------------------------------------------------------------------------- /facerec/negative/README: -------------------------------------------------------------------------------- 1 | The ORL face database 2 | --------------------- 3 | 4 | This directory contains a set of faces taken between April 1992 and 5 | April 1994 at the Olivetti Research Laboratory in Cambridge, UK. 6 | 7 | There are 10 different images of 40 distinct subjects. For some of the 8 | subjects, the images were taken at different times, varying lighting 9 | slightly, facial expressions (open/closed eyes, smiling/non-smiling) 10 | and facial details (glasses/no-glasses). All the images are taken 11 | against a dark homogeneous background and the subjects are in 12 | up-right, frontal position (with tolerance for some side movement). 13 | 14 | The files are in PGM format and can be conveniently viewed using the 'xv' 15 | program. The size of each image is 92x112, 8-bit grey levels. The images 16 | are organised in 40 directories (one for each subject) named as: 17 | 18 | sX 19 | 20 | where X indicates the subject number (between 1 and 40). In each directory 21 | there are 10 different images of the selected subject named as: 22 | 23 | Y.pgm 24 | 25 | where Y indicates which image for the specific subject (between 1 and 10). 26 | 27 | When using these images, please give credit to Olivetti Research Laboratory. 28 | A convenient reference is the face recognition work which uses some of 29 | these images: 30 | 31 | F. Samaria and A. Harter 32 | "Parameterisation of a stochastic model for human face identification" 33 | 2nd IEEE Workshop on Applications of Computer Vision 34 | December 1994, Sarasota (Florida). 35 | 36 | The paper is available via anonymous ftp from quince.cam-orl.co.uk and is 37 | stored in pub/users/fs/IEEE_workshop.ps.Z 38 | 39 | If you have any question, please email Ferdinando Samaria: fs@cam-orl.co.uk 40 | -------------------------------------------------------------------------------- /facerec/negative/s1/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s1/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s1/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s10/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s10/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s11/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s11/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s12/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s12/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s13/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s13/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s14/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s14/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s15/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s15/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s16/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s16/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s17/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s17/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s18/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s18/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s19/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s19/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s2/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s2/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s20/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s20/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s21/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s21/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s22/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s22/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s23/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s23/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s24/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s24/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s25/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s25/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s26/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s26/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s27/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s27/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s28/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s28/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s29/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s29/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s3/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s3/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s30/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s30/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s31/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s31/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s32/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s32/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s33/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s33/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s34/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s34/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s35/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s35/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s36/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s36/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s37/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s37/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s38/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s38/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s39/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s39/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s4/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s4/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s40/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s40/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s5/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s5/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s6/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s6/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s7/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s7/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s8/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s8/9.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/1.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/10.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/10.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/2.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/3.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/4.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/5.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/6.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/7.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/7.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/8.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/8.pgm -------------------------------------------------------------------------------- /facerec/negative/s9/9.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/facerec/negative/s9/9.pgm -------------------------------------------------------------------------------- /facerec/recognize.py: -------------------------------------------------------------------------------- 1 | import face 2 | from PyQt4.QtCore import QThread 3 | 4 | class Recognizer(QThread): 5 | 6 | faceImage = None 7 | model = None 8 | result = None 9 | label = None 10 | confidence = None 11 | 12 | def __init__(self): 13 | super(Recognizer, self).__init__() 14 | 15 | def run(self): 16 | if self.faceImage is None: 17 | # print 'face Image is None' 18 | return 19 | 20 | self.result = face.detectSingleFace(self.faceImage) 21 | 22 | if self.result is None: 23 | # print 'Could not detect single face!' 24 | return 25 | 26 | if self.model is None: 27 | # only return result when model is None 28 | return 29 | else: 30 | # print 'face detected' 31 | x, y, w, h = self.result 32 | # crop 33 | crop = face.resize(face.crop(self.faceImage, x, y, w, h)) 34 | self.label, self.confidence = self.model.predict(crop) 35 | 36 | def startRec(self, image, model): 37 | self.faceImage = image 38 | self.model = model 39 | 40 | self.start() 41 | -------------------------------------------------------------------------------- /facerec/train.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import cv2 4 | import fnmatch 5 | import numpy as np 6 | 7 | from configure import config, userManager 8 | import face 9 | 10 | def walkFiles(walkDir, match = '*'): 11 | """Generator function to iterate through all files in a directory recursively 12 | which match the given filename match parameter. 13 | """ 14 | for root, dirs, files in os.walk(walkDir): 15 | for fileName in fnmatch.filter(files, match): 16 | yield os.path.join(root, fileName) 17 | 18 | def prepareImage(fileName): 19 | """Read an image as grayscale and resize it to the appropriate size for 20 | training the face recognition model. 21 | """ 22 | return face.resize(cv2.imread(fileName, cv2.IMREAD_GRAYSCALE)) 23 | 24 | def normalize(X, low, high, dtype=None): 25 | """Normalizes a given array in X to a value between low and high. 26 | Adapted from python OpenCV face recognition example at: 27 | https://github.com/Itseez/opencv/blob/2.4/samples/python2/facerec_demo.py 28 | """ 29 | X = np.asarray(X) 30 | minX, maxX = np.min(X), np.max(X) 31 | # normalize to [0...1]. 32 | X = X - float(minX) 33 | X = X / float((maxX - minX)) 34 | # scale to [low...high]. 35 | X = X * (high-low) 36 | X = X + low 37 | if dtype is None: 38 | return np.asarray(X) 39 | return np.asarray(X, dtype=dtype) 40 | 41 | def trainFace(model): 42 | 43 | TRAINING_FILE = os.path.join(config.TRAINING_DIR, config.TRAINING_FILE) 44 | faces = [] 45 | labels = [] 46 | 47 | manager = userManager.UserManager() 48 | 49 | persons = os.listdir(config.FACES_DIR) 50 | for person in persons: 51 | manager.addUser(person) 52 | user = manager.getUserByName(person) 53 | print user 54 | label = int(user['id']) 55 | personDir = os.path.join(config.FACES_DIR, person) 56 | for fileName in walkFiles(personDir, '*.pgm'): 57 | faces.append(prepareImage(fileName)) 58 | labels.append(label) 59 | 60 | # Start training model 61 | model.train(np.asarray(faces), np.asarray(labels)) 62 | # Save model results 63 | model.save(TRAINING_FILE) 64 | 65 | 66 | -------------------------------------------------------------------------------- /facerec/training/users.csv: -------------------------------------------------------------------------------- 1 | we,1 2 | cf,2 3 | test,3 4 | hiro,4 5 | -------------------------------------------------------------------------------- /fingerec/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/fingerec/__init__.py -------------------------------------------------------------------------------- /fingerec/finger.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2016-4-26 4 | 5 | @author: imhey_000 6 | ''' 7 | import serial 8 | import struct 9 | 10 | from PyQt4.QtCore import QThread 11 | from ctypes import * 12 | from time import sleep 13 | 14 | #基本应答信息定义 15 | ACK_SUCCESS = 0x00 16 | ACK_FAIL = 0x01 17 | ACK_FULL = 0x04 18 | ACK_NO_USER = 0x05 19 | ACK_TIMEOUT = 0x08 20 | ACK_GO_OUT = 0x0F 21 | 22 | #用户信息定义 23 | ACK_ALL_USER = 0x00 24 | ACK_GUEST_USER = 0x01 25 | ACK_NORMAL_USER = 0x02 26 | ACK_MASTER_USER = 0x03 27 | 28 | #设置容量 MAX = 1000 29 | USER_MAX_CNT = 40 30 | 31 | #命令定义 32 | CMD_HEAD = 0xF5 33 | CMD_TAIL = 0xF5 34 | CMD_ADD_1 = 0x01 35 | CMD_ADD_2 = 0x02 36 | CMD_ADD_3 = 0x03 37 | CMD_MATCH = 0x0C 38 | CMD_DEL = 0x04 39 | CMD_DEL_ALL = 0x05 40 | CMD_USER_CNT = 0x09 41 | CMD_COM_LEV = 0x28 42 | CMD_LP_MODE = 0x2C 43 | CMD_TIMEOUT = 0x2E 44 | 45 | CMD_FINGER_DETECTED = 0x14 46 | 47 | class FingerPrint(object): 48 | 49 | gTxBuf = None 50 | gRsBuf = None 51 | device = None 52 | resource = '' 53 | rate = 0 54 | 55 | def __init__(self, resource='/dev/ttyAMA0', rate=19200): 56 | self.gTxBuf = (c_ubyte * 9)() 57 | self.gTxBuf[0] = 0x00 58 | self.gTxBuf[1] = 0x00 59 | self.gTxBuf[2] = 0x00 60 | self.gTxBuf[3] = 0x00 61 | self.gTxBuf[4] = 0x00 62 | self.gTxBuf[5] = 0x00 63 | self.gTxBuf[6] = 0x00 64 | self.gTxBuf[7] = 0x00 65 | self.gTxBuf[8] = 0x00 66 | 67 | self.gRsBuf = (c_ubyte * 9)() 68 | 69 | self.baudRate = rate 70 | self.resource = resource 71 | self.device = serial.Serial(resource, baudrate=rate) 72 | 73 | def packTxData(self): 74 | data = struct.pack('BBBBBBBBB', self.gTxBuf[0], 75 | self.gTxBuf[1], 76 | self.gTxBuf[2], 77 | self.gTxBuf[3], 78 | self.gTxBuf[4], 79 | self.gTxBuf[5], 80 | self.gTxBuf[6], 81 | self.gTxBuf[7], 82 | self.gTxBuf[8]) 83 | return data 84 | 85 | def packRsData(self): 86 | data = struct.pack('BBBBBBBB', self.gRsBuf[0], 87 | self.gRsBuf[1], 88 | self.gRsBuf[2], 89 | self.gRsBuf[3], 90 | self.gRsBuf[4], 91 | self.gRsBuf[5], 92 | self.gRsBuf[6], 93 | self.gRsBuf[7]) 94 | return data 95 | 96 | def unpackRsData(self): 97 | out = struct.unpack('BBBBBBBB', self.gRsBuf) 98 | return out 99 | 100 | def txAndRsCmd(self, sCnt, rCnt, delay): 101 | checkSum = 0 102 | self.device = serial.Serial(self.resource, self.baudRate, timeout=delay) 103 | 104 | data = self.packTxData() 105 | 106 | self.device.write(struct.pack('B', CMD_HEAD)) 107 | for i in range(0, sCnt): 108 | self.device.write(data[i]) 109 | #self.unpackData(data) 110 | checkSum ^= self.gTxBuf[i] 111 | self.device.write(struct.pack('B', checkSum)) 112 | self.device.write(struct.pack('B', CMD_TAIL)) 113 | 114 | self.gRsBuf = self.device.read(8) 115 | 116 | print 'gRsBuf len:', len(self.gRsBuf) 117 | 118 | if len(self.gRsBuf) != rCnt: 119 | print 'time out' 120 | return ACK_TIMEOUT 121 | if self.gRsBuf[0] != struct.pack('B', CMD_HEAD): 122 | print 'fail type error1' 123 | return ACK_FAIL 124 | if self.gRsBuf[rCnt - 1] != struct.pack('B', CMD_TAIL): 125 | print 'fail type error2' 126 | return ACK_FAIL 127 | if self.gRsBuf[1] != struct.pack('B', self.gTxBuf[0]): 128 | print 'fail type error3' 129 | return ACK_FAIL 130 | 131 | #debug 132 | reponse = self.unpackRsData() 133 | for i in range(0, 8): 134 | print hex(reponse[i]) 135 | 136 | checkSum = 0 137 | for i in range(1, (len(self.gRsBuf) - 1)): 138 | checkSum ^= struct.unpack('B', self.gRsBuf[i])[0] 139 | print struct.pack('B', checkSum) 140 | if checkSum != 0: 141 | print 'checksum error' 142 | return ACK_FAIL 143 | 144 | print 'success' 145 | return ACK_SUCCESS 146 | 147 | def addUser(self, userCode): 148 | userCount = self.getUserCount() 149 | if userCount >= USER_MAX_CNT: 150 | return ACK_FAIL 151 | 152 | print 'add 1' 153 | self.gTxBuf[0] = CMD_ADD_1 154 | self.gTxBuf[1] = 0x00 155 | self.gTxBuf[2] = userCode 156 | self.gTxBuf[3] = 0x03 157 | self.gTxBuf[4] = 0x00 158 | result = self.txAndRsCmd(5, 8, 200) 159 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 160 | print 'add 2' 161 | self.gTxBuf[0] = CMD_ADD_2 162 | result = self.txAndRsCmd(5, 8, 200) 163 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 164 | print 'add 3' 165 | self.gTxBuf[0] = CMD_ADD_3 166 | result = self.txAndRsCmd(5, 8, 200) 167 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 168 | print 'add success' 169 | return ACK_SUCCESS 170 | else: 171 | return ACK_FAIL 172 | else: 173 | return ACK_FAIL 174 | else: 175 | return ACK_FAIL 176 | 177 | def clearAllUser(self): 178 | self.gTxBuf[0] = CMD_DEL_ALL 179 | self.gTxBuf[1] = 0x00 180 | self.gTxBuf[2] = 0x00 181 | self.gTxBuf[3] = 0x00 182 | self.gTxBuf[4] = 0x00 183 | 184 | result = self.txAndRsCmd(5, 8, 50) 185 | print result 186 | #print struct.unpack('B', result)[0] 187 | #if result == ACK_SUCCESS and self.gRsBuf[4] == ACK_SUCCESS: 188 | if result == 0x00 and struct.unpack('B', self.gRsBuf[4])[0] == 0x00: 189 | print 'user all clear' 190 | None 191 | 192 | def isMasterUser(self, userID): 193 | if userID == 1 or userID == 2 or userID == 3: 194 | return True 195 | else: 196 | return False 197 | 198 | def verifyUser(self): 199 | self.gTxBuf[0] = CMD_MATCH 200 | self.gTxBuf[1] = 0x00 201 | self.gTxBuf[2] = 0x00 202 | self.gTxBuf[3] = 0x00 203 | self.gTxBuf[4] = 0x00 204 | 205 | result = self.txAndRsCmd(5, 8, 150) 206 | print hex(result) 207 | if result != ACK_TIMEOUT: 208 | if result == ACK_SUCCESS and self.isMasterUser(struct.unpack('B', self.gRsBuf[4])[0]): 209 | print 'verify success' 210 | return ACK_SUCCESS 211 | elif struct.unpack('B', self.gRsBuf[4])[0] == ACK_NO_USER: 212 | print 'no user' 213 | return ACK_NO_USER 214 | else: 215 | print 'verify fail' 216 | return ACK_GO_OUT 217 | else: 218 | return ACK_TIMEOUT 219 | 220 | def getUserCount(self): 221 | self.gTxBuf[0] = CMD_USER_CNT 222 | self.gTxBuf[1] = 0x00 223 | self.gTxBuf[2] = 0x00 224 | self.gTxBuf[3] = 0x00 225 | self.gTxBuf[4] = 0x00 226 | 227 | result = self.txAndRsCmd(5, 8, 10) 228 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 229 | print 'user count: ',struct.unpack('B', self.gRsBuf[3])[0] 230 | return struct.unpack('B', self.gRsBuf[3])[0] 231 | else: 232 | return 0xFF 233 | 234 | def getCompareLevel(self): 235 | self.gTxBuf[0] = CMD_COM_LEV 236 | self.gTxBuf[1] = 0x00 237 | self.gTxBuf[2] = 0x00 238 | self.gTxBuf[3] = 0x01 239 | self.gTxBuf[4] = 0x00 240 | 241 | result = self.txAndRsCmd(5, 8, 10) 242 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 243 | print 'compare level: ',struct.unpack('B', self.gRsBuf[3])[0] 244 | return struct.unpack('B', self.gRsBuf[3])[0] 245 | else: 246 | return 0xFF 247 | 248 | def setCompareLevel(self, tmp): 249 | self.gTxBuf[0] = CMD_COM_LEV 250 | self.gTxBuf[1] = 0x00 251 | self.gTxBuf[2] = tmp 252 | self.gTxBuf[3] = 0x00 253 | self.gTxBuf[4] = 0x00 254 | 255 | result = self.txAndRsCmd(5, 8, 10) 256 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 257 | return struct.unpack('B', self.gRsBuf[3])[0] 258 | else: 259 | return 0xFF 260 | 261 | def getTimeOut(self): 262 | self.gTxBuf[0] = CMD_TIMEOUT 263 | self.gTxBuf[1] = 0x00 264 | self.gTxBuf[2] = 0x00 265 | self.gTxBuf[3] = 0x01 266 | self.gTxBuf[4] = 0x00 267 | 268 | result = self.txAndRsCmd(5, 8, 10) 269 | if result == ACK_SUCCESS and struct.unpack('B', self.gRsBuf[4])[0] == ACK_SUCCESS: 270 | return struct.unpack('B', self.gRsBuf[3])[0] 271 | else: 272 | return 0xFF 273 | 274 | 275 | class FingerPrintThread(QThread): 276 | 277 | runFunction = 1 278 | ADD_USER = 0 279 | VERIFY = 1 280 | CLEAR_ALL_USER = 2 281 | SET_COM_LEV = 3 282 | GET_COM_LEV = 4 283 | GET_TIME_OUT = 5 284 | GET_USER_CNT = 6 285 | 286 | callBack = None 287 | resource = '' 288 | rate = 0 289 | 290 | def __init__(self, resource='/dev/ttyAMA0', rate=19200): 291 | super(FingerPrintThread, self).__init__() 292 | 293 | self.resource = resource 294 | self.rate = rate 295 | self.fingerPrint = FingerPrint(resource=self.resource, rate=self.rate) 296 | 297 | self.result = None 298 | 299 | def setFunction(self, runFunction): 300 | self.runFunction = runFunction 301 | 302 | def run(self): 303 | 304 | if self.runFunction == self.ADD_USER: 305 | self.result = self.fingerPrint.addUser(self.userCode) 306 | elif self.runFunction == self.VERIFY: 307 | self.result = self.fingerPrint.verifyUser() 308 | elif self.runFunction == self.CLEAR_ALL_USER: 309 | self.result = self.fingerPrint.clearAllUser() 310 | elif self.runFunction == self.SET_COM_LEV: 311 | self.result = self.fingerPrint.setCompareLevel(self.tmp) 312 | elif self.runFunction == self.GET_COM_LEV: 313 | self.result = self.fingerPrint.getCompareLevel() 314 | elif self.runFunction == self.GET_TIME_OUT: 315 | self.result = self.fingerPrint.getTimeOut() 316 | elif self.runFunction == self.GET_USER_CNT: 317 | self.result = self.fingerPrint.getUserCount() 318 | 319 | 320 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import sys 3 | import cv2 4 | 5 | from ui import mainwindow 6 | from camera import Video 7 | from configure import config 8 | 9 | from PyQt4.QtGui import QApplication 10 | 11 | def main(): 12 | 13 | model = cv2.createLBPHFaceRecognizer() 14 | model.load(config.TRAINING_FILE) 15 | 16 | video = Video.Video(0) 17 | video.setFrameSize(640, 480) 18 | video.setFPS(30) 19 | 20 | QtApp = QApplication(sys.argv) 21 | 22 | mainWindow = mainwindow.Ui_MainWindow() 23 | mainWindow.setModel(model) 24 | mainWindow.showFullScreen() 25 | mainWindow.setVideo(video) 26 | mainWindow.raise_() 27 | 28 | QtApp.exec_() 29 | 30 | if __name__ == '__main__': 31 | main() 32 | -------------------------------------------------------------------------------- /res/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/images.jpg -------------------------------------------------------------------------------- /res/pic/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/button.png -------------------------------------------------------------------------------- /res/pic/delete_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/delete_100x100.png -------------------------------------------------------------------------------- /res/pic/facerec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/facerec.png -------------------------------------------------------------------------------- /res/pic/finger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/finger.png -------------------------------------------------------------------------------- /res/pic/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/right.png -------------------------------------------------------------------------------- /res/pic/scanbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/scanbar.png -------------------------------------------------------------------------------- /res/pic/wrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/res/pic/wrong.png -------------------------------------------------------------------------------- /ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirohe/facerec-python/45d78b2f960cf557f388d882e8610aae1657a722/ui/__init__.py -------------------------------------------------------------------------------- /ui/css/style.css: -------------------------------------------------------------------------------- 1 | QScrollBar:vertical { 2 | width: 25px; 3 | } 4 | 5 | QScrollBar:horizontal { 6 | height: 25px; 7 | } 8 | 9 | QPushButton { 10 | background: #dfdfdf; 11 | } 12 | 13 | /*QMainWindow { 14 | background: #b7b7b7; 15 | }*/ 16 | 17 | QWidget#facerec { 18 | background: #ffffff; 19 | } 20 | 21 | QDialog { 22 | min-width: 100px; 23 | min-height: 50px; 24 | } 25 | -------------------------------------------------------------------------------- /ui/mainwindow.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import datetime 3 | from time import strftime 4 | 5 | from PyQt4 import QtCore, QtGui 6 | from PyQt4.QtCore import * 7 | from PyQt4.QtGui import * 8 | 9 | import ui 10 | 11 | try: 12 | _fromUtf8 = QtCore.QString.fromUtf8 13 | except AttributeError: 14 | def _fromUtf8(s): 15 | return s 16 | 17 | try: 18 | _encoding = QtGui.QApplication.UnicodeUTF8 19 | def _translate(context, text, disambig): 20 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 21 | except AttributeError: 22 | def _translate(context, text, disambig): 23 | return QtGui.QApplication.translate(context, text, disambig) 24 | 25 | style = QString(open('./ui/css/style.css').read()) 26 | 27 | class Ui_MainWindow(QMainWindow): 28 | model = None 29 | def __init__(self): 30 | super(Ui_MainWindow, self).__init__() 31 | 32 | self.setupUi(self) 33 | self.setStyleSheet(style) 34 | 35 | def setupUi(self, MainWindow): 36 | MainWindow.setObjectName(_fromUtf8("MainWindow")) 37 | MainWindow.resize(480, 800) 38 | 39 | self.centralwidget = QtGui.QWidget(MainWindow) 40 | self.centralwidget.setObjectName(_fromUtf8("centralwidget")) 41 | self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget) 42 | 43 | self.label_date = QtGui.QLabel(self.centralwidget) 44 | font = QtGui.QFont() 45 | font.setPointSize(28) 46 | self.label_date.setFont(font) 47 | self.verticalLayout.addWidget(self.label_date) 48 | 49 | self.lcd_time = QtGui.QLCDNumber(self.centralwidget) 50 | font = QtGui.QFont() 51 | font.setPointSize(24) 52 | self.lcd_time.setFont(font) 53 | self.lcd_time.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) 54 | self.lcd_time.setDigitCount(8) 55 | self.lcd_time.setLayoutDirection(QtCore.Qt.LeftToRight) 56 | self.verticalLayout.addWidget(self.lcd_time) 57 | 58 | self.label_welcome = QtGui.QLabel(self.centralwidget) 59 | font = QtGui.QFont() 60 | font.setPointSize(28) 61 | self.label_welcome.setFont(font) 62 | self.label_welcome.setAlignment(QtCore.Qt.AlignCenter) 63 | self.verticalLayout.addWidget(self.label_welcome) 64 | 65 | self.gridLayout_buttons = QtGui.QGridLayout() 66 | self.gridLayout_buttons.setSizeConstraint(QtGui.QLayout.SetMaximumSize) 67 | self.gridLayout_buttons.setMargin(0) 68 | self.gridLayout_buttons.setSpacing(50) 69 | 70 | #button face 71 | self.btn_face = QtGui.QPushButton(self.centralwidget) 72 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) 73 | sizePolicy.setHorizontalStretch(0) 74 | sizePolicy.setVerticalStretch(0) 75 | sizePolicy.setHeightForWidth(self.btn_face.sizePolicy().hasHeightForWidth()) 76 | self.btn_face.setSizePolicy(sizePolicy) 77 | font = QtGui.QFont() 78 | font.setPointSize(26) 79 | self.btn_face.setFont(font) 80 | self.gridLayout_buttons.addWidget(self.btn_face, 0, 0, 1, 1) 81 | 82 | self.btn_face.clicked.connect(self.btn_face_clicked) 83 | 84 | #button register 85 | self.btn_register = QtGui.QPushButton(self.centralwidget) 86 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) 87 | sizePolicy.setHorizontalStretch(0) 88 | sizePolicy.setVerticalStretch(0) 89 | sizePolicy.setHeightForWidth(self.btn_register.sizePolicy().hasHeightForWidth()) 90 | self.btn_register.setSizePolicy(sizePolicy) 91 | font = QtGui.QFont() 92 | font.setPointSize(26) 93 | self.btn_register.setFont(font) 94 | self.gridLayout_buttons.addWidget(self.btn_register, 1, 0, 1, 1) 95 | 96 | self.btn_register.clicked.connect(self.btn_register_clicked) 97 | 98 | self.verticalLayout.addLayout(self.gridLayout_buttons) 99 | self.verticalLayout.setStretch(0, 1) 100 | self.verticalLayout.setStretch(1, 2) 101 | self.verticalLayout.setStretch(2, 1) 102 | self.verticalLayout.setStretch(3, 4) 103 | MainWindow.setCentralWidget(self.centralwidget) 104 | self.menubar = QtGui.QMenuBar(MainWindow) 105 | self.menubar.setGeometry(QtCore.QRect(0, 0, 480, 23)) 106 | self.menubar.setObjectName(_fromUtf8("menubar")) 107 | MainWindow.setMenuBar(self.menubar) 108 | self.statusbar = QtGui.QStatusBar(MainWindow) 109 | self.statusbar.setObjectName(_fromUtf8("statusbar")) 110 | MainWindow.setStatusBar(self.statusbar) 111 | 112 | self.retranslateUi(MainWindow) 113 | QtCore.QMetaObject.connectSlotsByName(MainWindow) 114 | 115 | self._timer = QtCore.QTimer(self) 116 | self._timer.timeout.connect(self.updateTime) 117 | self._timer.start(1000) 118 | self.update() 119 | 120 | def updateTime(self): 121 | # date = datetime.datetime.now().strftime(' %Y-%m-%d') 122 | dateNow = datetime.datetime.now() 123 | dy = dateNow.strftime(' %Y') 124 | dm = dateNow.strftime('%m') 125 | dd = dateNow.strftime('%d') 126 | time = dateNow.strftime('%H:%M:%S') 127 | 128 | self.label_date.setText(dy+u'年'+dm+u'月'+dd+u'日') 129 | # self.lcd_time.setText(time) 130 | self.lcd_time.display(strftime("%H"+":"+"%M"+":"+"%S")) 131 | 132 | def setModel(self, model): 133 | self.model = model 134 | 135 | def setVideo(self, video): 136 | self.video = video 137 | 138 | def btn_face_clicked(self): 139 | print 'facerec clicked' 140 | self.video.open(0) 141 | self._timer.stop() 142 | 143 | self.facerec = ui.FaceRec(self) 144 | self.facerec.setModel(self.model) 145 | self.facerec.setVideo(self.video) 146 | self.setCentralWidget(self.facerec) 147 | 148 | def btn_register_clicked(self): 149 | print 'face register' 150 | self._timer.stop() 151 | 152 | self.register = ui.FaceRegister(self) 153 | self.register.setModel(self.model) 154 | self.register.setVideo(self.video) 155 | self.setCentralWidget(self.register) 156 | 157 | def retranslateUi(self, MainWindow): 158 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) 159 | self.label_date.setText(_translate("MainWindow", u" 0000年00月00日", None)) 160 | self.label_welcome.setText(unicode(u"人脸识别系统")) 161 | self.btn_face.setText(u"人脸识别") 162 | self.btn_register.setText(u"人脸录入") 163 | 164 | -------------------------------------------------------------------------------- /ui/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 480 10 | 800 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Arial 23 | 20 24 | 25 | 26 | 27 | 2016 年 4 月 4 日 28 | 29 | 30 | 25 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Arial 39 | 48 40 | 41 | 42 | 43 | ArrowCursor 44 | 45 | 46 | Qt::LeftToRight 47 | 48 | 49 | 00:00:00 50 | 51 | 52 | Qt::AlignCenter 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 宋体 61 | 28 62 | 63 | 64 | 65 | 物联创客空间 66 | 欢迎你 67 | 68 | 69 | Qt::AlignCenter 70 | 71 | 72 | 73 | 74 | 75 | 76 | QLayout::SetMaximumSize 77 | 78 | 79 | 10 80 | 81 | 82 | 10 83 | 84 | 85 | 10 86 | 87 | 88 | 10 89 | 90 | 91 | 50 92 | 93 | 94 | 95 | 96 | 97 | 0 98 | 0 99 | 100 | 101 | 102 | 103 | 0 104 | 0 105 | 106 | 107 | 108 | 109 | 宋体 110 | 26 111 | 112 | 113 | 114 | false 115 | 116 | 117 | 指纹验证 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 0 126 | 0 127 | 128 | 129 | 130 | 131 | 宋体 132 | 26 133 | 134 | 135 | 136 | 人脸识别 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 0 145 | 0 146 | 147 | 148 | 149 | 150 | 宋体 151 | 26 152 | 153 | 154 | 155 | 密码验证 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 0 164 | 0 165 | 166 | 167 | 168 | 169 | 宋体 170 | 26 171 | 172 | 173 | 174 | 系统设置 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 0 186 | 0 187 | 480 188 | 23 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /ui/pictureselect.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file '.\pictureselect.ui' 4 | # 5 | # Created by: PyQt4 UI code generator 4.11.4 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt4 import QtCore, QtGui 10 | 11 | try: 12 | _fromUtf8 = QtCore.QString.fromUtf8 13 | except AttributeError: 14 | def _fromUtf8(s): 15 | return s 16 | 17 | try: 18 | _encoding = QtGui.QApplication.UnicodeUTF8 19 | def _translate(context, text, disambig): 20 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 21 | except AttributeError: 22 | def _translate(context, text, disambig): 23 | return QtGui.QApplication.translate(context, text, disambig) 24 | 25 | class Ui_pictureSelect(object): 26 | def setupUi(self, pictureSelect): 27 | pictureSelect.setObjectName(_fromUtf8("pictureSelect")) 28 | pictureSelect.resize(480, 800) 29 | self.scrollArea = QtGui.QScrollArea(pictureSelect) 30 | self.scrollArea.setGeometry(QtCore.QRect(0, 100, 480, 550)) 31 | self.scrollArea.setWidgetResizable(True) 32 | self.scrollArea.setObjectName(_fromUtf8("scrollArea")) 33 | self.scrollAreaWidgetContents = QtGui.QWidget() 34 | self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 478, 548)) 35 | self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents")) 36 | self.gridLayoutWidget = QtGui.QWidget(self.scrollAreaWidgetContents) 37 | self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 481, 551)) 38 | self.gridLayoutWidget.setObjectName(_fromUtf8("gridLayoutWidget")) 39 | self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) 40 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) 41 | self.label = QtGui.QLabel(self.gridLayoutWidget) 42 | self.label.setObjectName(_fromUtf8("label")) 43 | self.gridLayout.addWidget(self.label, 0, 0, 1, 1) 44 | self.label_2 = QtGui.QLabel(self.gridLayoutWidget) 45 | self.label_2.setObjectName(_fromUtf8("label_2")) 46 | self.gridLayout.addWidget(self.label_2, 0, 1, 1, 1) 47 | self.label_4 = QtGui.QLabel(self.gridLayoutWidget) 48 | self.label_4.setObjectName(_fromUtf8("label_4")) 49 | self.gridLayout.addWidget(self.label_4, 1, 1, 1, 1) 50 | self.label_3 = QtGui.QLabel(self.gridLayoutWidget) 51 | self.label_3.setObjectName(_fromUtf8("label_3")) 52 | self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1) 53 | self.label_5 = QtGui.QLabel(self.gridLayoutWidget) 54 | self.label_5.setObjectName(_fromUtf8("label_5")) 55 | self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) 56 | self.label_6 = QtGui.QLabel(self.gridLayoutWidget) 57 | self.label_6.setObjectName(_fromUtf8("label_6")) 58 | self.gridLayout.addWidget(self.label_6, 2, 1, 1, 1) 59 | self.scrollArea.setWidget(self.scrollAreaWidgetContents) 60 | self.pushButton_back = QtGui.QPushButton(pictureSelect) 61 | self.pushButton_back.setGeometry(QtCore.QRect(190, 680, 100, 60)) 62 | font = QtGui.QFont() 63 | font.setPointSize(16) 64 | self.pushButton_back.setFont(font) 65 | self.pushButton_back.setObjectName(_fromUtf8("pushButton_back")) 66 | 67 | self.retranslateUi(pictureSelect) 68 | QtCore.QMetaObject.connectSlotsByName(pictureSelect) 69 | 70 | def retranslateUi(self, pictureSelect): 71 | pictureSelect.setWindowTitle(_translate("pictureSelect", "Form", None)) 72 | self.label.setText(_translate("pictureSelect", "TextLabel", None)) 73 | self.label_2.setText(_translate("pictureSelect", "TextLabel", None)) 74 | self.label_4.setText(_translate("pictureSelect", "TextLabel", None)) 75 | self.label_3.setText(_translate("pictureSelect", "TextLabel", None)) 76 | self.label_5.setText(_translate("pictureSelect", "TextLabel", None)) 77 | self.label_6.setText(_translate("pictureSelect", "TextLabel", None)) 78 | self.pushButton_back.setText(_translate("pictureSelect", "Back", None)) 79 | 80 | -------------------------------------------------------------------------------- /ui/soft_keyboard.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | #http://code.activestate.com/recipes/579118-pyqt-touch-input/ 4 | #author http://code.activestate.com/recipes/users/4193036/ 5 | 6 | from PyQt4 import QtGui, QtCore 7 | from decimal import Decimal 8 | 9 | # applicationle widgets 10 | SIP_WIDGETS = [QtGui.QLineEdit] 11 | 12 | class MyFlatPushButton(QtGui.QPushButton): 13 | def __init__(self, caption, min_size=(40, 40)): 14 | self.MIN_SIZE = min_size 15 | QtGui.QPushButton.__init__(self, caption) 16 | self.setFocusPolicy(QtCore.Qt.NoFocus) 17 | 18 | def sizeHint(self): 19 | return QtCore.QSize(self.MIN_SIZE[0], self.MIN_SIZE[1]) 20 | 21 | 22 | class SoftInputWidget(QtGui.QDialog): 23 | def __init__(self, parent_object, keyboard_type='default'): 24 | QtGui.QDialog.__init__(self) 25 | self.setWindowFlags(QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint) 26 | self.INPUT_WIDGET = None 27 | self.PARENT_OBJECT = parent_object 28 | self.signalMapper = QtCore.QSignalMapper(self) 29 | 30 | self.NO_ORD_KEY_LIST = list() 31 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Left) 32 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Up) 33 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Right) 34 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Down) 35 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Backspace) 36 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Enter) 37 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Tab) 38 | self.NO_ORD_KEY_LIST.append(QtCore.Qt.Key_Escape) 39 | 40 | self.do_layout(keyboard_type) 41 | 42 | self.signalMapper.mapped[int].connect(self.buttonClicked) 43 | 44 | def do_layout(self, keyboard_type='default'): 45 | """ 46 | @param keyboard_type: 47 | @return: 48 | """ 49 | gl = QtGui.QVBoxLayout() 50 | self.setFont(self.PARENT_OBJECT.font()) 51 | number_widget_list = [] 52 | sym_list = range(0, 10) 53 | for sym in sym_list: 54 | button = MyFlatPushButton(str(sym)) 55 | button.KEY_CHAR = ord(str(sym)) 56 | number_widget_list.append(button) 57 | 58 | button = MyFlatPushButton('*') 59 | button.KEY_CHAR = ord('*') 60 | number_widget_list.append(button) 61 | 62 | # alphabets 63 | alpha_widget_list = [] 64 | sym_list = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 65 | 'new_row', 66 | 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 67 | 'new_row', 68 | 'z', 'x', 'c', 'v', 'b', 'n', 'm'] 69 | for sym in sym_list: 70 | if sym == 'new_row': 71 | alpha_widget_list.append('new_row') 72 | else: 73 | button = MyFlatPushButton(sym) 74 | button.KEY_CHAR = ord(sym) 75 | alpha_widget_list.append(button) 76 | 77 | # back space 78 | control_widget_list = [] 79 | button = MyFlatPushButton('<') 80 | button.setToolTip('Backspace') 81 | button.KEY_CHAR = QtCore.Qt.Key_Backspace 82 | control_widget_list.append(button) 83 | control_widget_list.append('sep') 84 | 85 | # tab 86 | button = MyFlatPushButton('Tab') 87 | button.KEY_CHAR = QtCore.Qt.Key_Tab 88 | control_widget_list.append(button) 89 | control_widget_list.append('sep') 90 | 91 | # space 92 | button = MyFlatPushButton('SPC') 93 | button.KEY_CHAR = QtCore.Qt.Key_Space 94 | control_widget_list.append(button) 95 | control_widget_list.append('sep') 96 | 97 | # close 98 | button = MyFlatPushButton('X') 99 | button.KEY_CHAR = QtCore.Qt.Key_Escape 100 | control_widget_list.append(button) 101 | control_widget_list.append('sep') 102 | 103 | # enter 104 | button = MyFlatPushButton('ENT', min_size=(110, 60)) 105 | button.KEY_CHAR = QtCore.Qt.Key_Enter 106 | control_widget_list.append(button) 107 | control_widget_list.append('sep') 108 | 109 | alist = list() 110 | alist.append((QtCore.Qt.Key_Left, 'L-A')) 111 | alist.append((QtCore.Qt.Key_Right, 'R-A')) 112 | alist.append((QtCore.Qt.Key_Up, 'U-A')) 113 | alist.append((QtCore.Qt.Key_Down, 'D-A')) 114 | for key in alist: 115 | button = MyFlatPushButton(key[1]) 116 | button.KEY_CHAR = key[0] 117 | control_widget_list.append(button) 118 | 119 | MAX_COL = 10 120 | col = 0 121 | tlist = list() 122 | if keyboard_type == 'numeric': 123 | widget_list = number_widget_list 124 | elif keyboard_type == 'alpha': 125 | widget_list = alpha_widget_list 126 | else: 127 | widget_list = list() 128 | widget_list.extend(number_widget_list) 129 | widget_list.append('new_row') 130 | widget_list.extend(alpha_widget_list) 131 | 132 | widget_list.append('new_row') 133 | widget_list.extend(control_widget_list) 134 | 135 | for widget in widget_list: 136 | if widget == 'new_row': 137 | col = MAX_COL 138 | elif widget == 'sep': 139 | tlist.append(self.get_vline()) 140 | continue 141 | else: 142 | tlist.append(widget) 143 | widget.clicked.connect(self.signalMapper.map) 144 | self.signalMapper.setMapping(widget, widget.KEY_CHAR) 145 | 146 | if col == MAX_COL: 147 | col = 0 148 | v = QtGui.QHBoxLayout() 149 | v.addStretch() 150 | v.setSpacing(2) 151 | map(v.addWidget, tlist) 152 | v.addStretch() 153 | gl.addLayout(v) 154 | tlist = [] 155 | else: 156 | col += 1 157 | 158 | v = QtGui.QHBoxLayout() 159 | v.setSpacing(2) 160 | v.addStretch() 161 | map(v.addWidget, tlist) 162 | v.addStretch() 163 | gl.addLayout(v) 164 | gl.setContentsMargins(0, 0, 0, 0) 165 | gl.setSpacing(2) 166 | gl.setSizeConstraint(gl.SetFixedSize) 167 | 168 | self.setLayout(gl) 169 | 170 | def reject(self): 171 | self.buttonClicked(QtCore.Qt.Key_Escape) 172 | 173 | def buttonClicked(self, char_ord): 174 | w = self.INPUT_WIDGET 175 | if char_ord in self.NO_ORD_KEY_LIST: 176 | keyPress = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, char_ord, QtCore.Qt.NoModifier, '') 177 | else: 178 | keyPress = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, char_ord, QtCore.Qt.NoModifier, chr(char_ord)) 179 | 180 | # send keypress event to widget 181 | QtGui.QApplication.sendEvent(w, keyPress) 182 | 183 | # line edit returnPressed event is triggering twise for press and release both 184 | # that is why do not send release event for special key 185 | if char_ord not in self.NO_ORD_KEY_LIST: 186 | keyRelease = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, char_ord, QtCore.Qt.NoModifier, '') 187 | QtGui.QApplication.sendEvent(w, keyRelease) 188 | 189 | # hide on enter or esc button click 190 | if char_ord in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Escape): 191 | self.hide() 192 | 193 | def show_input_panel(self, widget): 194 | self.INPUT_WIDGET = widget 195 | self.show() 196 | self.update_panel_position() 197 | 198 | def update_panel_position(self): 199 | widget = self.INPUT_WIDGET 200 | if not widget: return 201 | 202 | widget_rect = widget.rect() 203 | widget_bottom = widget.mapToGlobal(QtCore.QPoint(widget.frameGeometry().x(), widget.frameGeometry().y())).y() 204 | screen_height = QtGui.qApp.desktop().availableGeometry().height() 205 | input_panel_height = self.geometry().height() + 5 206 | 207 | if (screen_height - widget_bottom) > input_panel_height: 208 | # display input panel at bottom of widget 209 | panelPos = QtCore.QPoint(widget_rect.left(), widget_rect.bottom() + 2) 210 | else: 211 | # display input panel at top of widget 212 | panelPos = QtCore.QPoint(widget_rect.left(), widget_rect.top() - input_panel_height) 213 | 214 | panelPos = widget.mapToGlobal(panelPos) 215 | self.move(panelPos) 216 | 217 | def _get_line(self, vertical=True): 218 | line = QtGui.QFrame() 219 | line.setContentsMargins(0, 0, 0, 0) 220 | if vertical is True: 221 | line.setFrameShape(line.VLine) 222 | else: 223 | line.setFrameShape(line.HLine) 224 | line.setFrameShadow(line.Sunken) 225 | return line 226 | 227 | def get_hline(self): 228 | return self._get_line(vertical=False) 229 | 230 | def get_vline(self): 231 | return self._get_line() 232 | 233 | 234 | class TouchInterface(QtCore.QObject): 235 | def __init__(self, PARENT_WIDGET): 236 | QtCore.QObject.__init__(self) 237 | self._PARENT_WIDGET = PARENT_WIDGET 238 | self._input_panel_all = SoftInputWidget(PARENT_WIDGET, 'default') 239 | self._input_panel_numeric = SoftInputWidget(PARENT_WIDGET, 'numeric') 240 | 241 | def childEvent(self, event): 242 | if event.type() == QtCore.QEvent.ChildAdded: 243 | if isinstance(event.child(), *SIP_WIDGETS): 244 | event.child().installEventFilter(self) 245 | 246 | def eventFilter(self, widget, event): 247 | if self._PARENT_WIDGET.focusWidget() == widget and event.type() == QtCore.QEvent.MouseButtonPress: 248 | if hasattr(widget, 'keyboard_type'): 249 | if widget.keyboard_type == 'default': 250 | self._input_panel_all.show_input_panel(widget) 251 | elif widget.keyboard_type == 'numeric': 252 | self._input_panel_numeric.show_input_panel(widget) 253 | 254 | return False 255 | 256 | 257 | class TouchInputWidget(QtGui.QWidget): 258 | def __init__(self): 259 | QtGui.QWidget.__init__(self) 260 | self.touch_interface = TouchInterface(self) 261 | 262 | def childEvent(self, event): 263 | self.touch_interface.childEvent(event) 264 | 265 | def eventFilter(self, widget, event): 266 | print event.type() 267 | return self.touch_interface.eventFilter(widget, event) 268 | 269 | -------------------------------------------------------------------------------- /ui/ui.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from PyQt4.QtCore import * 4 | from PyQt4.QtGui import * 5 | 6 | from facerec import recognize, train 7 | from facerec import face 8 | from camera import VideoStream 9 | from configure import config, userManager 10 | 11 | from soft_keyboard import * 12 | 13 | import os 14 | import cv2 15 | 16 | try: 17 | _fromUtf8 = QtCore.QString.fromUtf8 18 | except AttributeError: 19 | def _fromUtf8(s): 20 | return s 21 | 22 | try: 23 | _encoding = QtGui.QApplication.UnicodeUTF8 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 26 | except AttributeError: 27 | def _translate(context, text, disambig): 28 | return QtGui.QApplication.translate(context, text, disambig) 29 | 30 | #Qt css样式文件 31 | style = QString(open('./ui/css/style.css').read()) 32 | 33 | #显示视频的Qt控件 34 | #setRect当前一帧图像上画出方框,用于标记人脸的位置 35 | #setRectColor设置方框的颜色 36 | #setUserLabel在方框旁边添加识别信息,比如识别到的用户名 37 | class VideoFrame(QtGui.QLabel): 38 | 39 | userName = None 40 | pen_faceRect = QtGui.QPen() 41 | pen_faceRect.setColor(QtGui.QColor(255, 0, 0)) 42 | x = 0;y = 0;w = 0;h = 0 43 | 44 | def __init__(self, parent): 45 | QtGui.QLabel.__init__(self, parent) 46 | 47 | def setRect(self, x, y, w, h): 48 | self.x, self.y, self.w, self.h = x, y, w, h 49 | 50 | def setRectColor(self, r, g, b): 51 | self.pen_faceRect.setColor(QtGui.QColor(r, g, b)) 52 | 53 | def setUserLabel(self, userName): 54 | self.userName = userName 55 | 56 | def paintEvent(self, event): 57 | QtGui.QLabel.paintEvent(self,event) 58 | painter = QtGui.QPainter(self) 59 | painter.setPen(self.pen_faceRect) 60 | painter.drawRect(self.x, self.y, self.w, self.h) 61 | if self.userName != None: 62 | painter.drawText(self.x, self.y+15, self.userName) 63 | 64 | #人脸识别界面 65 | class FaceRec(QWidget): 66 | 67 | model = None 68 | confidence = -1 69 | label = '' 70 | faceRect = None 71 | 72 | captureFlag = 0 73 | 74 | confidences = [] 75 | 76 | def __init__(self, mainWindow): 77 | super(FaceRec, self).__init__() 78 | self.mainWindow = mainWindow 79 | self.manager = userManager.UserManager() 80 | 81 | self.setupUi(self) 82 | 83 | self._timer = QtCore.QTimer(self) 84 | self._timer.timeout.connect(self.playVideo) 85 | self._timer.start(10) 86 | self.update() 87 | 88 | def setModel(self, model): 89 | self.model = model 90 | 91 | def setupUi(self, FaceRec): 92 | FaceRec.setObjectName(_fromUtf8("FaceRec")) 93 | FaceRec.resize(480, 800) 94 | 95 | font = QtGui.QFont() 96 | font.setPointSize(16) 97 | 98 | self.video_frame = VideoFrame(FaceRec) 99 | self.video_frame.setGeometry(QtCore.QRect(0, 100, 480, 360)) 100 | 101 | self.pushButton_back = QtGui.QPushButton(FaceRec) 102 | self.pushButton_back.setGeometry(QtCore.QRect(190, 600, 80, 50)) 103 | self.pushButton_back.setFont(font) 104 | self.pushButton_back.clicked.connect(self.pushButton_back_clicked) 105 | 106 | self.label_title = QtGui.QLabel(FaceRec) 107 | self.label_title.setGeometry(QtCore.QRect(10, 10, 460, 50)) 108 | self.label_title.setFont(font) 109 | 110 | self.label_info = QtGui.QLabel(FaceRec) 111 | self.label_info.setGeometry(QtCore.QRect(0, 500, 480, 50)) 112 | self.label_info.setFont(font) 113 | 114 | self.retranslateUi(FaceRec) 115 | QtCore.QMetaObject.connectSlotsByName(FaceRec) 116 | 117 | def pushButton_capture_clicked(self): 118 | print 'capture clicked' 119 | self.captureFlag = 10 120 | 121 | def pushButton_back_clicked(self): 122 | self._timer.stop() 123 | self.vs.stop() 124 | self.video.release() 125 | self.mainWindow.setupUi(self.mainWindow) 126 | 127 | def pushButton_capture_clicked(self): 128 | self.startRec() 129 | 130 | def setVideo(self, video): 131 | self.video = video 132 | 133 | self.vs = VideoStream.VideoStream(self.video,'192.168.1.113', 8888) 134 | #self.vs.startStream() 135 | 136 | self.startRec() 137 | 138 | def playVideo(self): 139 | try: 140 | pixMap_frame = QtGui.QPixmap.fromImage(self.video.getQImageFrame()) 141 | x = 0;y = 0;w = 0;h = 0 142 | if self.faceRect != None: 143 | #640x480 to 480x360 144 | x, y, w, h = self.faceRect[0]*0.75, self.faceRect[1]*0.75, self.faceRect[2]*0.75, self.faceRect[3]*0.75 145 | self.video_frame.setRect(x, y, w, h) 146 | self.video_frame.setPixmap(pixMap_frame) 147 | self.video_frame.setScaledContents(True) 148 | except TypeError: 149 | print "No frame" 150 | 151 | def startRec(self): 152 | self.recognizer = recognize.Recognizer() 153 | self.recognizer.finished.connect(self.reciveRecognizeResult) 154 | image = self.video.getGrayCVImage() 155 | self.recognizer.startRec(image, self.model) 156 | 157 | def reciveRecognizeResult(self): 158 | self.faceRect = self.recognizer.result 159 | userName = None 160 | if not self.video.is_release: 161 | if self.recognizer.result != None: 162 | self.confidences.append(self.recognizer.confidence) 163 | mean = sum(self.confidences) / float(len(self.confidences)) 164 | print 'label:',self.recognizer.label 165 | print 'confidence: %.4f'%self.recognizer.confidence,'mean:%.4f'%mean 166 | 167 | user = self.manager.getUserById(self.recognizer.label) 168 | 169 | self.video_frame.setUserLabel(userName) 170 | 171 | if user != None: 172 | userName = user['userName'] 173 | 174 | if self.recognizer.confidence <= 60: 175 | self.video_frame.setRectColor(0, 255, 0) 176 | else: 177 | self.video_frame.setRectColor(255, 0, 0) 178 | 179 | info = 'user: ' + str(userName) + ' | confidence: ' + str(self.recognizer.confidence) 180 | self.label_info.setText(info) 181 | self.startRec() 182 | 183 | def retranslateUi(self, FaceRec): 184 | FaceRec.setWindowTitle(_translate("FaceRec", u"from", None)) 185 | self.label_title.setText(_translate("FaceRec", u"人脸识别", None)) 186 | self.video_frame.setText(_translate("FaceRec", "video_frame", None)) 187 | self.label_info.setText(_translate("FaceRec", "label_info", None)) 188 | self.pushButton_back.setText(_translate("FaceRec", u"返回", None)) 189 | 190 | #人脸录入界面 191 | class FaceRegister(QWidget): 192 | 193 | faceRect = None 194 | 195 | captureFlag = 0 196 | personName = None 197 | recOver = False 198 | model = None 199 | 200 | def __init__(self, mainWindow): 201 | super(FaceRegister, self).__init__() 202 | 203 | self.mainWindow = mainWindow 204 | self.manager = userManager.UserManager() 205 | 206 | self.setupUi(self) 207 | 208 | self._timer = QtCore.QTimer(self) 209 | self._timer.timeout.connect(self.playVideo) 210 | #self._timer.start(10) 211 | 212 | self.update() 213 | 214 | def setupUi(self, FaceRegister): 215 | FaceRegister.setObjectName(_fromUtf8("FaceRegister")) 216 | FaceRegister.resize(480, 800) 217 | 218 | self.inputDialog = InputDialog(self.reciveUserName) 219 | 220 | font = QtGui.QFont() 221 | font.setPointSize(16) 222 | 223 | self.label_title = QtGui.QLabel(FaceRegister) 224 | self.label_title.setGeometry(QtCore.QRect(20, 50, 440, 60)) 225 | self.label_title.setFont(font) 226 | 227 | self.progressBar = QtGui.QProgressBar(FaceRegister) 228 | self.progressBar.setGeometry(QtCore.QRect(20, 470, 440, 60)) 229 | self.progressBar.setRange(0, 20) 230 | self.progressBar.setValue(0) 231 | self.progressBar.setVisible(False) 232 | 233 | self.video_frame = VideoFrame(FaceRegister) 234 | self.video_frame.setGeometry(QtCore.QRect(0, 100, 480, 360)) 235 | 236 | self.pushButton_capture = QtGui.QPushButton(FaceRegister) 237 | self.pushButton_capture.setGeometry(QtCore.QRect(190, 560, 100, 60)) 238 | self.pushButton_capture.setFont(font) 239 | self.pushButton_capture.clicked.connect(self.pushButton_capture_clicked) 240 | 241 | self.pushButton_back = QtGui.QPushButton(FaceRegister) 242 | self.pushButton_back.setGeometry(QtCore.QRect(190, 650, 100, 60)) 243 | font = QtGui.QFont() 244 | font.setPointSize(16) 245 | self.pushButton_back.setFont(font) 246 | self.pushButton_back.clicked.connect(self.pushButton_back_clicked) 247 | 248 | self.retranslateUi(FaceRegister) 249 | QtCore.QMetaObject.connectSlotsByName(FaceRegister) 250 | 251 | def setVideo(self, video): 252 | self.video = video 253 | if self.video.is_release: 254 | self.video.open(0) 255 | 256 | def setModel(self, model): 257 | self.model = model 258 | 259 | def playVideo(self): 260 | try: 261 | pixMap_frame = QtGui.QPixmap.fromImage(self.video.getQImageFrame()) 262 | x = 0;y = 0;w = 0;h = 0 263 | if self.faceRect != None: 264 | x, y, w, h = self.faceRect[0]*0.75, self.faceRect[1]*0.75, self.faceRect[2]*0.75, self.faceRect[3]*0.75 265 | self.video_frame.setRect(x, y, w, h) 266 | self.video_frame.setPixmap(pixMap_frame) 267 | self.video_frame.setScaledContents(True) 268 | except TypeError: 269 | print 'No frame' 270 | 271 | def startRec(self): 272 | self.recognizer = recognize.Recognizer() 273 | self.recognizer.finished.connect(self.reciveRecognizeResult) 274 | image = self.video.getGrayCVImage() 275 | self.recognizer.startRec(image, None) 276 | 277 | def reciveRecognizeResult(self): 278 | self.faceRect = self.recognizer.result 279 | if self.faceRect != None and self.captureFlag != 0: 280 | x, y, w, h = self.faceRect 281 | crop = face.crop(self.recognizer.faceImage, x, y, w, h) 282 | personDir = os.path.join(config.FACES_DIR, self.personName) 283 | if not os.path.exists(personDir): 284 | os.makedirs(personDir) 285 | fileName = os.path.join(personDir, 'face_'+'%03d.pgm'%self.captureFlag) 286 | cv2.imwrite(fileName, crop) 287 | print 'capture' 288 | self.captureFlag -= 1 289 | self.progressBar.setValue(20 - self.captureFlag) 290 | if self.captureFlag == 0: 291 | self.recOver = True 292 | print 'capture over' 293 | self.video.release() 294 | self.startPictureSelect() 295 | 296 | if not self.video.is_release and self.recOver == False: 297 | self.startRec() 298 | 299 | def reciveUserName(self, name): 300 | self.personName = str(name) 301 | 302 | #self.inputDialog.deleteLater() 303 | print name 304 | personDir = os.path.join(config.FACES_DIR, self.personName) 305 | if os.path.exists(personDir): 306 | print 'person already exist' 307 | #TODO alert 308 | self.inputDialog.show(u'用户已存在!') 309 | else: 310 | self.pushButton_capture.setEnabled(False) 311 | self.captureFlag = 20 312 | self.progressBar.setVisible(True) 313 | self.label_title.setText(u'开始截取图片') 314 | self._timer.start(10) 315 | self.startRec() 316 | 317 | def startPictureSelect(self): 318 | print 'start picture select' 319 | pictureSelect = PictureSelect(self.mainWindow, self.personName) 320 | pictureSelect.setModel(self.model) 321 | self.mainWindow.setCentralWidget(pictureSelect) 322 | 323 | def pushButton_capture_clicked(self): 324 | self.inputDialog.setInfo(u'请输入用户名') 325 | self.inputDialog.show() 326 | self.inputDialog.clear() 327 | 328 | def pushButton_back_clicked(self): 329 | self._timer.stop() 330 | self.video.release() 331 | self.mainWindow.setupUi(self.mainWindow) 332 | 333 | def retranslateUi(self, FaceRegister): 334 | FaceRegister.setWindowTitle(_translate("FaceRegister", "Form", None)) 335 | self.label_title.setText(_translate("FaceRegister", u" ", None)) 336 | self.video_frame.setText(_translate("FaceRegister", " ", None)) 337 | self.pushButton_capture.setText(_translate("FaceRegister", u"开始", None)) 338 | self.pushButton_back.setText(_translate("FaceRegister", u"返回", None)) 339 | 340 | #软键盘控件 341 | class InputDialog(TouchInputWidget): 342 | def __init__(self, callback): 343 | TouchInputWidget.__init__(self) 344 | 345 | self.callback = callback 346 | 347 | self.labelInfo = QtGui.QLabel() 348 | 349 | self.editUserName = QtGui.QLineEdit() 350 | self.editUserName.keyboard_type = 'default' 351 | 352 | self.pushButton_accept = QtGui.QPushButton(self) 353 | self.pushButton_accept.setText(u'确认') 354 | self.pushButton_accept.clicked.connect(self.reciveUserName) 355 | 356 | gl = QtGui.QVBoxLayout() 357 | gl.addWidget(self.pushButton_accept) 358 | gl.addWidget(self.labelInfo) 359 | gl.addWidget(self.editUserName) 360 | 361 | self.setLayout(gl) 362 | 363 | def setInfo(self, info): 364 | self.labelInfo.setText(info) 365 | 366 | def clear(self): 367 | self.editUserName.clear() 368 | 369 | def reciveUserName(self): 370 | self.touch_interface._input_panel_all.hide() 371 | self.userName = self.editUserName.text() 372 | if self.userName == '': 373 | return 374 | self.callback(self.userName) 375 | self.hide() 376 | 377 | #图片选择界面 378 | class PictureSelect(QWidget): 379 | 380 | pictures = [] 381 | pictureNames = [] 382 | path = None 383 | model = None 384 | 385 | def __init__(self, mainWindow, path): 386 | super(PictureSelect, self).__init__() 387 | self.mainWindow = mainWindow 388 | self.path = path 389 | 390 | self.setupUi(self) 391 | 392 | self.readPictures() 393 | 394 | self.showPictures() 395 | 396 | def setupUi(self, pictureSelect): 397 | pictureSelect.setObjectName(_fromUtf8("pictureSelect")) 398 | pictureSelect.resize(480, 800) 399 | 400 | self.setStyleSheet(style) 401 | 402 | font = QtGui.QFont() 403 | font.setPointSize(18) 404 | 405 | self.label_info = QtGui.QLabel(pictureSelect) 406 | self.label_info.setGeometry(QtCore.QRect(0, 20, 480, 50)) 407 | self.label_info.setFont(font) 408 | 409 | self.scrollArea = QtGui.QScrollArea(pictureSelect) 410 | self.scrollArea.setGeometry(QtCore.QRect(0, 100, 480, 550)) 411 | self.scrollArea.setWidgetResizable(False) 412 | self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) 413 | 414 | self.scrollAreaWidgetContents = QtGui.QWidget() 415 | self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 478, 548)) 416 | 417 | self.gridLayoutWidget = QtGui.QWidget(self.scrollArea) 418 | 419 | self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) 420 | 421 | self.scrollArea.setWidget(self.gridLayoutWidget) 422 | 423 | font = QtGui.QFont() 424 | font.setPointSize(16) 425 | 426 | self.pushButton_delete = QtGui.QPushButton(pictureSelect) 427 | self.pushButton_delete.setGeometry(QtCore.QRect(70, 680, 100, 60)) 428 | self.pushButton_delete.setFont(font) 429 | self.pushButton_delete.clicked.connect(self.pushButton_delete_clicked) 430 | 431 | self.pushButton_ok = QtGui.QPushButton(pictureSelect) 432 | self.pushButton_ok.setGeometry(QtCore.QRect(190, 680, 100, 60)) 433 | self.pushButton_ok.setFont(font) 434 | self.pushButton_ok.clicked.connect(self.pushButton_ok_clicked) 435 | 436 | self.pushButton_back = QtGui.QPushButton(pictureSelect) 437 | self.pushButton_back.setGeometry(QtCore.QRect(310, 680, 100, 60)) 438 | self.pushButton_back.setFont(font) 439 | self.pushButton_back.setObjectName(_fromUtf8("pushButton_back")) 440 | self.pushButton_back.clicked.connect(self.pushButton_back_clicked) 441 | 442 | self.retranslateUi(pictureSelect) 443 | QtCore.QMetaObject.connectSlotsByName(pictureSelect) 444 | 445 | def setModel(self, model): 446 | self.model = model 447 | 448 | def readPictures(self): 449 | self.pictures = [] 450 | self.pictureNames = [] 451 | path = os.path.join(config.FACES_DIR, self.path) 452 | for fileName in train.walkFiles(path, '*.pgm'): 453 | self.pictures.append(QtGui.QPixmap(fileName)) 454 | self.pictureNames.append(fileName) 455 | 456 | def clearGridLayout(self): 457 | for i in reversed(range(self.gridLayout.count())): 458 | self.gridLayout.itemAt(i).widget().deleteLater() 459 | 460 | def showPictures(self): 461 | for i in range(0, len(self.pictures)): 462 | label_pic = PictureLabel() 463 | label_pic.mousePressEvent = label_pic.clicked 464 | h = self.pictures[i].height() 465 | w = self.pictures[i].width() 466 | label_pic.setFixedSize(QSize(w, h)) 467 | label_pic.setPixmap(self.pictures[i]) 468 | label_pic.setPictureName(self.pictureNames[i]) 469 | self.gridLayout.addWidget(label_pic, i/2, i%2, 1, 1) 470 | self.gridLayoutWidget.setFixedSize(self.gridLayout.sizeHint()) 471 | 472 | def trainFinish(self): 473 | dialog = QtGui.QMessageBox() 474 | dialog.setWindowTitle('info') 475 | dialog.setText(u'人脸录入已完成(%s)'%self.path) 476 | if dialog.exec_(): 477 | print 'over' 478 | self.label_info.setText(u'选择要删除的图片,点击删除按钮进行删除') 479 | self.pushButton_ok.setEnabled(True) 480 | 481 | def pushButton_delete_clicked(self): 482 | self.pushButton_delete.setEnabled(False) 483 | for i in range(self.gridLayout.count()): 484 | item = self.gridLayout.itemAt(i) 485 | if item != None: 486 | label_pic = item.widget() 487 | print label_pic.pictureName 488 | if label_pic.selected: 489 | print 'delete',label_pic.pictureName 490 | os.remove(os.path.join(config.FACES_DIR, self.path, label_pic.pictureName)) 491 | 492 | self.clearGridLayout() 493 | self.readPictures() 494 | self.showPictures() 495 | self.pushButton_delete.setEnabled(True) 496 | 497 | def pushButton_ok_clicked(self): 498 | self.label_info.setText(u'正在录入人脸...') 499 | self.pushButton_ok.setEnabled(False) 500 | self.trainThread = TrainThread(self.model, os.path.join(config.TRAINING_DIR, config.TRAINING_FILE)) 501 | self.trainThread.finished.connect(self.trainFinish) 502 | self.trainThread.start() 503 | 504 | def pushButton_back_clicked(self): 505 | self.gridLayout = None 506 | self.pictures = [] 507 | self.pictureNames = [] 508 | self.mainWindow.setupUi(self.mainWindow) 509 | 510 | def retranslateUi(self, pictureSelect): 511 | pictureSelect.setWindowTitle(_translate("pictureSelect", "Form", None)) 512 | self.label_info.setText(_translate("pictureSelect", u"选择要删除的图片,点击删除按钮进行删除", None)) 513 | self.pushButton_back.setText(_translate("pictureSelect", u"返回", None)) 514 | self.pushButton_delete.setText(_translate("pictureSelect", u"删除", None)) 515 | self.pushButton_ok.setText(_translate("pictureSelect", u"录入", None)) 516 | 517 | class TrainThread(QtCore.QThread): 518 | 519 | model = None 520 | trainFileName = None 521 | 522 | def __init__(self, model, trainFileName): 523 | super(TrainThread, self).__init__() 524 | 525 | self.model = model 526 | self.trainFileName = trainFileName 527 | 528 | def run(self): 529 | train.trainFace(self.model) 530 | print 'train faces over' 531 | self.model.load(self.trainFileName) 532 | print 'model reload over' 533 | 534 | #显示单个图像的Qt控件 535 | class PictureLabel(QtGui.QLabel): 536 | 537 | selected = False 538 | pictureName = None 539 | 540 | def __init__(self): 541 | QtGui.QLabel.__init__(self) 542 | self.deleteImage = QtGui.QPixmap('./res/pic/delete_100x100.png') 543 | 544 | def setPictureName(self, name): 545 | self.pictureName = name 546 | 547 | def clicked(self, event): 548 | print 'clicked' 549 | if self.selected: 550 | self.selected = False 551 | else: 552 | self.selected = True 553 | self.update() 554 | 555 | def paintEvent(self, event): 556 | QtGui.QLabel.paintEvent(self,event) 557 | if self.selected: 558 | painter = QtGui.QPainter(self) 559 | size = self.sizeHint() 560 | x = size.width()/2 - 50 561 | y = size.height()/2 - 50 562 | painter.drawPixmap(x, y, self.deleteImage) 563 | --------------------------------------------------------------------------------