├── bupt.jpg ├── sample1.png ├── sample2.png ├── sample3.png ├── py_excel.xlsx ├── faces ├── start.jpg ├── N101Monday_1_2.jpg ├── N101Monday_3_4.jpg ├── N103Monday_3_4.jpg ├── training.xml ├── testing.xml ├── image_metadata_stylesheet.xsl ├── training_with_face_landmarks.xml └── testing_with_face_landmarks.xml ├── reference └── 面向大学课堂的抬头率检测系统的研究与实现_张杰.caj ├── camera.py ├── camera.ipynb ├── README.md ├── code1_window_and_face_recognition.py ├── code2_final.py ├── code1_window_and_face_recognition.py.ipynb ├── code0_initial.ipynb └── code2_password_final.ipynb /bupt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/bupt.jpg -------------------------------------------------------------------------------- /sample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/sample1.png -------------------------------------------------------------------------------- /sample2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/sample2.png -------------------------------------------------------------------------------- /sample3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/sample3.png -------------------------------------------------------------------------------- /py_excel.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/py_excel.xlsx -------------------------------------------------------------------------------- /faces/start.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/faces/start.jpg -------------------------------------------------------------------------------- /faces/N101Monday_1_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/faces/N101Monday_1_2.jpg -------------------------------------------------------------------------------- /faces/N101Monday_3_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/faces/N101Monday_3_4.jpg -------------------------------------------------------------------------------- /faces/N103Monday_3_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/faces/N103Monday_3_4.jpg -------------------------------------------------------------------------------- /reference/面向大学课堂的抬头率检测系统的研究与实现_张杰.caj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caidongqi/TaiTouLv_Jiance/HEAD/reference/面向大学课堂的抬头率检测系统的研究与实现_张杰.caj -------------------------------------------------------------------------------- /camera.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[2]: 5 | 6 | 7 | import numpy as np 8 | import cv2 #需要提前安装opencv 9 | 10 | cap = cv2.VideoCapture(0) 11 | print(cap.isOpened()) 12 | ret, img = cap.read() 13 | print(ret, img) 14 | cv2.imshow("Image", img) 15 | cv2.imwrite(r"C:\Users\10485\Desktop\TaiTouLv_Jiance", img) #此处填写摄像头拍摄的照片的存储路径 16 | cv2.waitKey(0) 17 | 18 | # 释放摄像头资源 19 | cap.release() 20 | 21 | 22 | # In[ ]: 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /faces/training.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Training faces 5 | These are images from the PASCAL VOC 2011 dataset. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /faces/testing.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Testing faces 5 | These are images from the PASCAL VOC 2011 dataset. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /camera.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stdout", 10 | "output_type": "stream", 11 | "text": [ 12 | "False\n", 13 | "False None\n" 14 | ] 15 | }, 16 | { 17 | "ename": "error", 18 | "evalue": "OpenCV(4.4.0) D:\\Build\\OpenCV\\opencv-4.4.0\\modules\\highgui\\src\\window.cpp:384: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'\n", 19 | "output_type": "error", 20 | "traceback": [ 21 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 22 | "\u001b[1;31merror\u001b[0m Traceback (most recent call last)", 23 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0mret\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimg\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcap\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mret\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0mcv2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimshow\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Image\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[0mcv2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimwrite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mr\"C:\\Users\\10485\\Desktop\\TaiTouLv_Jiance\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mcv2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwaitKey\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", 24 | "\u001b[1;31merror\u001b[0m: OpenCV(4.4.0) D:\\Build\\OpenCV\\opencv-4.4.0\\modules\\highgui\\src\\window.cpp:384: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "import numpy as np\n", 30 | "import cv2 #需要提前安装opencv\n", 31 | "\n", 32 | "cap = cv2.VideoCapture(0)\n", 33 | "print(cap.isOpened())\n", 34 | "ret, img = cap.read()\n", 35 | "print(ret, img)\n", 36 | "cv2.imshow(\"Image\", img)\n", 37 | "cv2.imwrite(r\"C:\\Users\\10485\\Desktop\\TaiTouLv_Jiance\", img) #此处填写摄像头拍摄的照片的存储路径\n", 38 | "cv2.waitKey(0)\n", 39 | "\n", 40 | "# 释放摄像头资源\n", 41 | "cap.release()" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [] 50 | } 51 | ], 52 | "metadata": { 53 | "kernelspec": { 54 | "display_name": "Python 3", 55 | "language": "python", 56 | "name": "python3" 57 | }, 58 | "language_info": { 59 | "codemirror_mode": { 60 | "name": "ipython", 61 | "version": 3 62 | }, 63 | "file_extension": ".py", 64 | "mimetype": "text/x-python", 65 | "name": "python", 66 | "nbconvert_exporter": "python", 67 | "pygments_lexer": "ipython3", 68 | "version": "3.8.3" 69 | } 70 | }, 71 | "nbformat": 4, 72 | "nbformat_minor": 4 73 | } 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 抬头率检测系统 2 | 3 | [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) 4 | 5 | 本仓库设计并实现了一个简易的抬头率检测系统,通过调用摄像头来获取教室的实时图像,对图像进行人脸识别,并结合数据库中的选课人数计算该堂课的实时抬头率。此外,我们还设计了一个UI操作界面,以便管理人员浏览和管理。 6 | 7 | 本仓库包含以下内容: 8 | 9 | 1. 系统运行所需要的全部源码(共有ipython和py两种文件格式,均可独立完整运行) 10 | 2. 人脸识别所需要的训练好的[模型文件](./haarcascade_frontalface_alt2.xml) 11 | 3. 运行测试所需要的图片和数据 12 | 13 | ## 目录 14 | 15 | - [内容简介](#内容简介) 16 | - [代码功能介绍](#代码功能介绍) 17 | - [关键代码讲解](#关键代码讲解) 18 | - [运行说明和结果展示](#) 19 | - [参考资料](#参考资料) 20 | - [相关仓库](#相关仓库) 21 | - [维护者](#维护者) 22 | - [如何贡献](#如何贡献) 23 | 24 | ## 内容简介 25 | ### 代码功能介绍 26 | 本文档中仅介绍.ipython文件,对应的.py文件不再赘述,内容都是一样的。 27 | 28 | #### [camera.ipynb](./camera.ipynb) 29 | 此代码实现了调用摄像头以截取某一时刻的图像,并将其储存在本地的功能。 30 | 31 | #### [code0_initial.ipynb](./code0_initial.ipynb) 32 | 这个代码就是最原始的主体代码,人脸识别部分主要参考了dlib的一个样例程序,代码里还保留着一些原始的英文注释,讲解了一下环境配置中可能出现的问题,有兴趣的可以看一看。 33 | 34 | #### [code1_window_and_face_recognition.py.ipynb](./code1_window_and_face_recognition.py.ipynb) 35 | 此代码是第一个较为完整地代码,已经可以完整地运行出来,并带了UI界面。 36 | 37 | #### [code2_password_final.ipynb](./code2_password_final.ipynb) 38 | 正如这个代码的文件名,它就是在上一个版本的代码中加入了登录界面,并完善了代码的各项功能,是本系统最终使用的代码。嫌麻烦的完全可以不看前两个版本的代码,直接看这个最终版就行。 39 | 40 | 代码主要由三大部分组成:界面代码、人脸检测代码以及数据调用代码。 41 | 42 | 界面代码是用的tkinter库,人脸检测代码也是直接调用的opencv的一个人脸检测的接口,调用训练好的模型之后直接对图片infer就行了。数据调用代码主要调用两种数据,分别是课堂信息和教室的实时图片。前者被用来进行抬头率检测,后者用来将教室的实时图像显示在UI界面上,以便观察和对照。 43 | 44 | ### 关键代码讲解 45 | 其实整个代码也比较简单,没啥好讲的,基本是界面的代码,我就讲一下最核心的功能,人脸检测函数吧。 46 | ```sh 47 | def inspect(): ## 声明一个函数 48 | nonlocal face ## 将face变量定义为全局,这样就不用再把face给return了,函数里跑出的face值,函数外也能获得,可以保证face值得实时性 49 | str1 = "教室" 50 | str2 = "课上的抬头率为:" 51 | path = r'.\faces' ## 图片保存的路径 52 | pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' ## 根据选择的教室和时间获取相应图片的名称 (图片的名称是需要按一定的规则来命名的,否则会报错) 53 | p = path + '/' + pic_path ## 将图片的总路径和单个图片的名称拼接起来,得到单个图片的路径 54 | img = cv2.imread(p) ## 读取图片 55 | color = (0, 255, 0) 56 | 57 | grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ## 只选取单个通道的图片数据进行处理,就是把彩图变成灰度图 58 | 59 | classfier = cv2.CascadeClassifier( 60 | r".\haarcascade_frontalface_alt2.xml") ## 创建一个分类器,这个分类器是已经训练好的,调用了一个已经训练好的模型文件 61 | faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32)) ## 通过分类器对图像进行人脸识别 62 | a = len(faceRects) ## faceRects有几条数据,就说明有几个人脸,从而判断出有几个人抬头了 63 | face = a 64 | str3 = str(a) ## 改变数据格式,以便后面将其输出在UI界面上 65 | ``` 66 | ### 运行说明和结果展示 67 | 68 | #### 运行说明 69 | 编码语言:python3.7 70 | 编程环境: Jupyter notebook 71 | 主要依赖库: Opencv 72 | 73 | #### 结果展示 74 | 75 | 首先是登录界面: 76 | 77 | ![登录界面](./sample1.png) 78 | 79 | 因为时间原因,本系统并未真正实现密码验证功能,有兴趣的小伙伴可以结合mysql数据库等等来实现这一功能。 80 | 81 | 其次是系统的初始化界面,也就是登录之后会跳转到的界面: 82 | 83 | ![初始化界面](./sample2.png) 84 | 85 | 最后就是抬头率的结果展示画面,在选取了相应的教室和时间后,依次点击界面上的两个按钮,就可以显示出抬头率,并在侧面显示出教室的实时图像: 86 | 87 | ![展示界面](./sample3.png) 88 | 89 | ## 参考资料 90 | 本系统只是简单地实现了一个功能齐全的抬头率检测管理系统,但是并未对各项功能的准确率和效率进行优化,如果有对准确率和效率有更高要求的小伙伴,可以去找一些相关的人脸识别的参考文献,本仓库中附带了一篇本人看过的文献,思路与我的这个系统较为类似,但是做的更加深入、细致,也有各种准确率等等的指标,文章已经附在仓库中,点击[链接](./reference/面向大学课堂的抬头率检测系统的研究与实现_张杰.caj)即可获得全文。 91 | 92 | 93 | ## 相关仓库 94 | 95 | - [Standard Readme](https://github.com/RichardLitt/standard-readme) — 💌 写高质量 README 的艺术。 96 | 97 | ## 维护者 98 | 99 | [@bupt_caidongqi](https://github.com/caidongqi)。 100 | 101 | ## 如何贡献 102 | 103 | 非常欢迎你的加入![提一个 Issue](https://github.com/caidongqi/Industrial-Applet/issues/new) 或者提交一个 Pull Request。 104 | 105 | 106 | ### 贡献者 107 | 108 | 感谢以下参与项目的人: 109 | -------------------------------------------------------------------------------- /faces/image_metadata_stylesheet.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 30 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 57 | 58 | 59 | 60 | 61 | Dataset name:
62 | Dataset comment:

63 | Number of images:
64 | Number of boxes:
65 |
66 |
67 | 68 | 69 | 70 |

Only displaying the first images.

71 |
72 |
73 | 74 | 75 | 76 | 77 | 78 | (Number of boxes: ) 79 |
80 | 81 | 82 |
83 | 84 | 85 | 86 |
87 | 88 |
89 |
90 | 91 | 92 | 97 |
98 |
99 |
100 |
101 |
102 |
103 | 104 | 105 |
106 | 107 | 108 | 109 |
110 | -------------------------------------------------------------------------------- /code1_window_and_face_recognition.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[14]: 5 | 6 | 7 | import cv2 8 | import numpy as np 9 | import sys, os, glob, numpy 10 | from skimage import io 11 | from PIL import Image, ImageTk 12 | import tkinter as tk 13 | import time 14 | from tkinter import ttk 15 | from tkinter import IntVar 16 | import xlrd 17 | 18 | ##GUI代码 19 | window = tk.Tk() # 这是一个窗口object 20 | window.title('抬头率监测系统') 21 | window.geometry('600x400') # 窗口大小 22 | 23 | 24 | def read_data(): 25 | path = r'C:\Users\10485\Desktop\head_detecting\py_excel.xlsx' 26 | 27 | # 打开文件 28 | data = xlrd.open_workbook(path) 29 | # path + '/' +file 是文件的完整路径 30 | # 获取表格数目 31 | # nums = len(data.sheets()) 32 | # for i in range(nums): 33 | # # 根据sheet顺序打开sheet 34 | # sheet1 = data.sheets()[i] 35 | 36 | # 根据sheet名称获取 37 | sheet1 = data.sheet_by_name('Sheet1') 38 | sheet2 = data.sheet_by_name('Sheet2') 39 | # 获取sheet(工作表)行(row)、列(col)数 40 | nrows = sheet1.nrows # 行 41 | ncols = sheet1.ncols # 列 42 | # print(nrows, ncols) 43 | 44 | # 获取教室名称列表 45 | global room_name, time_name 46 | room_name = sheet2.col_values(0) 47 | time_name = sheet2.col_values(1) 48 | print(room_name) 49 | print(time_name) 50 | # 获取单元格数据 51 | # 1.cell(单元格)获取 52 | # cell_A1 = sheet2.cell(0, 0).value 53 | # print(cell_A1) 54 | # 2.使用行列索引 55 | # cell_A2 = sheet2.row(0)[1].value 56 | 57 | 58 | read_data() 59 | 60 | 61 | def gettime(): # 当前时间显示 62 | timestr = time.strftime('%Y.%m.%d %H:%M', time.localtime(time.time())) 63 | lb.configure(text=timestr) 64 | window.after(1000, gettime) 65 | 66 | 67 | lb = tk.Label(window, text='', font=("黑体", 20)) 68 | lb.grid(column=0, row=0) 69 | gettime() 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | # In[ ]: 79 | 80 | 81 | # 选择教室标签加下拉菜单 82 | choose_classroom = tk.Label(window, text="选择教室", width=15, height=2, font=("黑体", 12)).grid(column=0, row=1, sticky='w') 83 | class_room = tk.StringVar() 84 | class_room_chosen = ttk.Combobox(window, width=20, height=10, textvariable=class_room, state='readonly') 85 | class_room_chosen['values'] = room_name 86 | class_room_chosen.grid(column=0, row=1, sticky='e') 87 | 88 | # 选择课时标签加下拉菜单 89 | choose_time = tk.Label(window, text="选择课时", width=15, height=2, font=("黑体", 12)).grid(column=0, row=2, sticky='w') 90 | course_time = tk.StringVar() 91 | course_time_chosen = ttk.Combobox(window, width=20, height=10, textvariable=course_time, state='readonly') 92 | course_time_chosen['values'] = time_name 93 | course_time_chosen.grid(column=0, row=2, sticky='e') 94 | 95 | pic_tip = tk.Label(window, text="所选教室时实图像", width=16, height=2, font=("黑体", 12)).grid(column=1, row=2, sticky='s') 96 | 97 | img = r'C:\Users\10485\Desktop\head_detecting\faces\1.jpg' 98 | img_open = Image.open(img) 99 | # 显示图片的代码 100 | (x, y) = img_open.size # read image size 101 | x_s = 200 # define standard width 102 | y_s = y * x_s // x # calc height based on standard width 103 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 104 | img_png = ImageTk.PhotoImage(img_adj) 105 | 106 | Image2 = tk.Label(window, bg='white', bd=20, height=y_s * 0.83, width=x_s * 0.83, 107 | image=img_png) ##0.83用来消除白框 108 | Image2.grid(column=1, row=4, sticky='w') 109 | 110 | flag = IntVar() 111 | flag.set(0) 112 | 113 | ''' 114 | if(flag.get()!=0): 115 | pic_path = str(flag.get())+'.jpg' 116 | 117 | img_open = Image.open(img) 118 | # 显示图片的代码 119 | (x, y) = img_open.size # read image size 120 | x_s = 200 # define standard width 121 | y_s = y * x_s // x # calc height based on standard width 122 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 123 | img_png = ImageTk.PhotoImage(img_adj) 124 | Image2 = tk.Label(window, bg='black', bd=20, height=y_s * 0.83, width=x_s * 0.83, imagevariable=img_png) ##0.83用来消除白框 125 | Image2.grid(column=1, row=4, sticky='w') 126 | ''' 127 | face = 0 128 | 129 | 130 | def rate_cal(): 131 | path = r'C:\Users\10485\Desktop\head_detecting\py_excel.xlsx' 132 | data = xlrd.open_workbook(path) 133 | sheet1 = data.sheet_by_name('Sheet1') 134 | nrows = sheet1.nrows # 行 135 | ncols = sheet1.ncols # 列 136 | total = 0 137 | for i in range(nrows): 138 | if (sheet1.cell(i, 0).value == class_room_chosen.get() and sheet1.cell(i, 1).value == course_time_chosen.get()): 139 | total = sheet1.cell(i, 2).value 140 | print(total) 141 | global rate 142 | rate = face / total 143 | print(rate) 144 | 145 | 146 | 147 | def pic_re(): 148 | if (flag.get() == 0): 149 | pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' 150 | img = os.path.join(r'C:\Users\10485\Desktop\head_detecting\faces', pic_path) 151 | img_open = Image.open(img) 152 | # 显示图片的代码 153 | (x, y) = img_open.size # read image size 154 | global x_s 155 | global y_s 156 | x_s = 200 # define standard width 157 | y_s = y * x_s // x # calc height based on standard width 158 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 159 | global img_png ##这里一定要设置为全局变量,不然图片无法正常显示!!!!!!!!!!! 160 | img_png = ImageTk.PhotoImage(img_adj) 161 | Image2.configure(image=img_png) 162 | window.update_idletasks() 163 | 164 | 165 | def inspect(): 166 | str1 = "教室" 167 | str2 = "课上的抬头人数为:" 168 | path = r'C:\Users\10485\Desktop\head_detecting\faces' 169 | pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' 170 | p = path +'/'+pic_path 171 | img = cv2.imread(p) 172 | color = (0, 255, 0) 173 | 174 | grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 175 | 176 | classfier = cv2.CascadeClassifier( 177 | r"C:\Users\10485\Desktop\head_detecting\haarcascade_frontalface_alt2.xml") 178 | faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32)) 179 | a = len(faceRects) 180 | global face 181 | face = a 182 | str3 = str(a) 183 | var.set(class_room_chosen.get() + str1 + course_time.get() + str2 + str3) 184 | 185 | 186 | var = tk.StringVar() # tkinter中的字符串 187 | display = tk.Label(window, textvariable=var, font=('Arial', 12), width=38, height=10) 188 | display.grid(column=0, row=4, sticky='n') 189 | 190 | # Adding a Button 191 | b = ttk.Button(window, text="Click Me!", command=inspect) 192 | b.grid(column=0, row=4) 193 | 194 | rate_button = ttk.Button(window, text="Get_rate", command=rate_cal).grid(column=0, row=6) 195 | 196 | pic_button = ttk.Button(window, text="Updata picture", command=pic_re).grid(column=0, row=5) 197 | window.mainloop() 198 | 199 | 200 | # In[ ]: 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /code2_final.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[1]: 5 | 6 | 7 | import cv2 8 | import numpy as np 9 | import sys, os, glob, numpy 10 | from skimage import io 11 | from PIL import Image, ImageTk 12 | import tkinter as tk 13 | import time 14 | from tkinter import ttk 15 | from tkinter import IntVar 16 | import xlrd 17 | 18 | 19 | # In[2]: 20 | 21 | 22 | ##登录界面 23 | root = tk.Tk() 24 | root.title('欢迎进入北邮抬头率检测系统!') 25 | root.geometry('600x420') 26 | #增加背景图片 27 | img = Image.open(r"C:\Users\10485\Desktop\head_detecting\bupt.jpg") 28 | img2 = img.resize((600, 420), Image.ANTIALIAS) 29 | photo = ImageTk.PhotoImage(img2) 30 | theLabel = tk.Label(root, 31 | text="",#内容 32 | justify=tk.LEFT,#对齐方式 33 | image=photo,#加入图片 34 | compound = tk.CENTER,#关键:设置为背景图片 35 | font=("华文行楷",20),#字体和字号 36 | fg = "white")#前景色 37 | theLabel.place(x=0,y=0) 38 | 39 | 40 | # In[3]: 41 | 42 | 43 | ##主窗口 44 | def get_in(): 45 | # GUI代码 46 | root.destroy() 47 | window = tk.Tk() # 这是一个窗口object 48 | window.title('抬头率监测系统') 49 | window.geometry('600x400') # 窗口大小 50 | 51 | def read_data(): 52 | path = r'C:\Users\10485\Desktop\head_detecting\py_excel.xlsx' 53 | 54 | # 打开文件 55 | data = xlrd.open_workbook(path) 56 | # path + '/' +file 是文件的完整路径 57 | # 获取表格数目 58 | # nums = len(data.sheets()) 59 | # for i in range(nums): 60 | # # 根据sheet顺序打开sheet 61 | # sheet1 = data.sheets()[i] 62 | 63 | # 根据sheet名称获取 64 | sheet1 = data.sheet_by_name('Sheet1') 65 | sheet2 = data.sheet_by_name('Sheet2') 66 | # 获取sheet(工作表)行(row)、列(col)数 67 | nrows = sheet1.nrows # 行 68 | ncols = sheet1.ncols # 列 69 | # print(nrows, ncols) 70 | 71 | # 获取教室名称列表 72 | global room_name, time_name 73 | room_name = sheet2.col_values(0) 74 | time_name = sheet2.col_values(1) 75 | print(room_name) 76 | print(time_name) 77 | # 获取单元格数据 78 | # 1.cell(单元格)获取 79 | # cell_A1 = sheet2.cell(0, 0).value 80 | # print(cell_A1) 81 | # 2.使用行列索引 82 | # cell_A2 = sheet2.row(0)[1].value 83 | 84 | read_data() 85 | 86 | def gettime(): # 当前时间显示 87 | timestr = time.strftime('%Y.%m.%d %H:%M', time.localtime(time.time())) 88 | lb.configure(text=timestr) 89 | window.after(1000, gettime) 90 | 91 | lb = tk.Label(window, text='', font=("黑体", 20)) 92 | lb.grid(column=0, row=0) 93 | gettime() 94 | 95 | # 选择教室标签加下拉菜单 96 | choose_classroom = tk.Label(window, text="选择教室", width=15, height=2, font=("黑体", 12)).grid(column=0, row=1, 97 | sticky='w') 98 | class_room = tk.StringVar() 99 | class_room_chosen = ttk.Combobox(window, width=20, height=10, textvariable=class_room, state='readonly') 100 | class_room_chosen['values'] = room_name 101 | class_room_chosen.grid(column=0, row=1, sticky='e') 102 | 103 | # 选择课时标签加下拉菜单 104 | choose_time = tk.Label(window, text="选择课时", width=15, height=2, font=("黑体", 12)).grid(column=0, row=2, sticky='w') 105 | course_time = tk.StringVar() 106 | course_time_chosen = ttk.Combobox(window, width=20, height=10, textvariable=course_time, state='readonly') 107 | course_time_chosen['values'] = time_name 108 | course_time_chosen.grid(column=0, row=2, sticky='e') 109 | 110 | pic_tip = tk.Label(window, text="所选教室时实图像", width=16, height=2, font=("黑体", 12)).grid(column=1, row=2, sticky='s') 111 | 112 | img = r'C:\Users\10485\Desktop\head_detecting\faces\start.jpg'##初始化图片界面 113 | img_open = Image.open(img) 114 | # 显示图片的代码 115 | (x, y) = img_open.size # read image size 116 | x_s = 200 # define standard width 117 | y_s = y * x_s // x # calc height based on standard width 118 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 119 | img_png = ImageTk.PhotoImage(img_adj) 120 | 121 | Image2 = tk.Label(window, bg='white', bd=20, height=y_s * 0.83, width=x_s * 0.83, 122 | image=img_png) ##0.83用来消除白框 123 | Image2.grid(column=1, row=4, sticky='w') 124 | 125 | flag = IntVar() 126 | flag.set(0) 127 | 128 | ''' 129 | if(flag.get()!=0): 130 | pic_path = str(flag.get())+'.jpg' 131 | 132 | img_open = Image.open(img) 133 | # 显示图片的代码 134 | (x, y) = img_open.size # read image size 135 | x_s = 200 # define standard width 136 | y_s = y * x_s // x # calc height based on standard width 137 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 138 | img_png = ImageTk.PhotoImage(img_adj) 139 | Image2 = tk.Label(window, bg='black', bd=20, height=y_s * 0.83, width=x_s * 0.83, imagevariable=img_png) ##0.83用来消除白框 140 | Image2.grid(column=1, row=4, sticky='w') 141 | ''' 142 | 143 | def rate_cal(): 144 | face = 0 145 | 146 | def inspect(): ##将人脸检测函数内嵌 147 | nonlocal face 148 | str1 = "教室" 149 | str2 = "课上的抬头率为:" 150 | path = r'C:\Users\10485\Desktop\head_detecting\faces' 151 | pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' 152 | p = path + '/' + pic_path 153 | img = cv2.imread(p) 154 | color = (0, 255, 0) 155 | 156 | grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 157 | 158 | classfier = cv2.CascadeClassifier( 159 | r"C:\Users\10485\Desktop\head_detecting\haarcascade_frontalface_alt2.xml") 160 | faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32)) 161 | a = len(faceRects) 162 | face = a 163 | str3 = str(a) 164 | inspect() 165 | path = r'C:\Users\10485\Desktop\head_detecting\py_excel.xlsx' 166 | data = xlrd.open_workbook(path) 167 | sheet1 = data.sheet_by_name('Sheet1') 168 | nrows = sheet1.nrows # 行 169 | ncols = sheet1.ncols # 列 170 | total = 0 171 | for i in range(nrows): 172 | if (sheet1.cell(i, 0).value == class_room_chosen.get() and sheet1.cell(i, 173 | 1).value == course_time_chosen.get()): 174 | total = sheet1.cell(i, 2).value 175 | print(total) 176 | global rate 177 | print(face) 178 | rate = face /total 179 | print(rate) 180 | str1 = "教室" 181 | str2 = "课上的抬头率为:" 182 | str3 = str(rate) 183 | var.set(class_room_chosen.get() + str1 + course_time.get() + str2 + str3) 184 | 185 | def pic_re(): 186 | if (flag.get() == 0): 187 | pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' 188 | img = os.path.join(r'C:\Users\10485\Desktop\head_detecting\faces', pic_path) #图片的命名需按规则来命名,具体规则可参考示例图片名称 189 | img_open = Image.open(img) 190 | # 显示图片的代码 191 | (x, y) = img_open.size # read image size 192 | global x_s 193 | global y_s 194 | x_s = 200 # define standard width 195 | y_s = y * x_s // x # calc height based on standard width 196 | img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS) 197 | global img_png ##这里一定要设置为全局变量,不然图片无法正常显示!!!!!!!!!!! 198 | img_png = ImageTk.PhotoImage(img_adj) 199 | Image2.configure(image=img_png) 200 | window.update_idletasks() 201 | 202 | 203 | var = tk.StringVar() # tkinter中的字符串 204 | display = tk.Label(window, textvariable=var, font=('Arial', 12), width=38, height=10) 205 | display.grid(column=0, row=4, sticky='n') 206 | 207 | # Adding a Button 208 | rate_button = ttk.Button(window, text="Get_rate", command=rate_cal).grid(column=0, row=4, sticky='s') 209 | 210 | pic_button = ttk.Button(window, text="Updata picture", command=pic_re).grid(column=0, row=5) 211 | window.mainloop() 212 | 213 | 214 | # In[4]: 215 | 216 | 217 | name = tk.Label(root, text="请输入用户名:", width=16, height=1) 218 | name.place(x=50, y=220) 219 | name_tap = tk.Entry(root, width=16) 220 | name_tap.place(x=250, y=220) 221 | 222 | code = tk.Label(root, text="请输入密码:", width=16, height=1) 223 | code.place(x=50, y=250) 224 | code_tap = tk.Entry(root, width=16) 225 | code_tap.place(x=250, y=250) 226 | 227 | 228 | get_into = ttk.Button(root, text='登录', command=get_in).place(x=250,y=300) 229 | root.mainloop() 230 | 231 | 232 | # In[ ]: 233 | 234 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /code1_window_and_face_recognition.py.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 14, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stdout", 10 | "output_type": "stream", 11 | "text": [ 12 | "['N101', 'N102', 'N103', 'N104', 'N105', 'N106', 'N107', 'N108', 'N109', 'N110', 'N111', 'N112', 'N113', 'N114', 'N115', 'N116', 'N201', 'N202', 'N203', 'N204']\n", 13 | "['Monday_1_2', 'Monday_3_4', 'Monday_5_6', 'Monday_7_8', 'Tuesday_1_2', 'Tuesday_3_4', 'Tuesday_5_6', 'Tuesday_7_8', 'Wednesday_1_2', 'Wednesday_3_4', 'Wednesday_5_6', 'Wednesday_7_8', 'Thursday_1_2', 'Thursday_3_4', 'Thursday_5_6', 'Thursday_7_8', 'Friday_1_2', 'Friday_3_4', 'Friday_5_6', 'Friday_7_8']\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "import cv2\n", 19 | "import numpy as np\n", 20 | "import sys, os, glob, numpy\n", 21 | "from skimage import io\n", 22 | "from PIL import Image, ImageTk\n", 23 | "import tkinter as tk\n", 24 | "import time\n", 25 | "from tkinter import ttk\n", 26 | "from tkinter import IntVar\n", 27 | "import xlrd\n", 28 | "\n", 29 | "##GUI代码\n", 30 | "window = tk.Tk() # 这是一个窗口object\n", 31 | "window.title('抬头率监测系统')\n", 32 | "window.geometry('600x400') # 窗口大小\n", 33 | "\n", 34 | "\n", 35 | "def read_data():\n", 36 | " path = r'C:\\Users\\10485\\Desktop\\head_detecting\\py_excel.xlsx'\n", 37 | "\n", 38 | " # 打开文件\n", 39 | " data = xlrd.open_workbook(path)\n", 40 | " # path + '/' +file 是文件的完整路径\n", 41 | " # 获取表格数目\n", 42 | " # nums = len(data.sheets())\n", 43 | " # for i in range(nums):\n", 44 | " # # 根据sheet顺序打开sheet\n", 45 | " # sheet1 = data.sheets()[i]\n", 46 | "\n", 47 | " # 根据sheet名称获取\n", 48 | " sheet1 = data.sheet_by_name('Sheet1')\n", 49 | " sheet2 = data.sheet_by_name('Sheet2')\n", 50 | " # 获取sheet(工作表)行(row)、列(col)数\n", 51 | " nrows = sheet1.nrows # 行\n", 52 | " ncols = sheet1.ncols # 列\n", 53 | " # print(nrows, ncols)\n", 54 | "\n", 55 | " # 获取教室名称列表\n", 56 | " global room_name, time_name\n", 57 | " room_name = sheet2.col_values(0)\n", 58 | " time_name = sheet2.col_values(1)\n", 59 | " print(room_name)\n", 60 | " print(time_name)\n", 61 | " # 获取单元格数据\n", 62 | " # 1.cell(单元格)获取\n", 63 | " # cell_A1 = sheet2.cell(0, 0).value\n", 64 | " # print(cell_A1)\n", 65 | " # 2.使用行列索引\n", 66 | " # cell_A2 = sheet2.row(0)[1].value\n", 67 | "\n", 68 | "\n", 69 | "read_data()\n", 70 | "\n", 71 | "\n", 72 | "def gettime(): # 当前时间显示\n", 73 | " timestr = time.strftime('%Y.%m.%d %H:%M', time.localtime(time.time()))\n", 74 | " lb.configure(text=timestr)\n", 75 | " window.after(1000, gettime)\n", 76 | "\n", 77 | "\n", 78 | "lb = tk.Label(window, text='', font=(\"黑体\", 20))\n", 79 | "lb.grid(column=0, row=0)\n", 80 | "gettime()\n", 81 | "\n", 82 | "\n", 83 | "\n", 84 | "\n", 85 | "\n", 86 | "\n", 87 | "\n" 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": 15, 93 | "metadata": {}, 94 | "outputs": [ 95 | { 96 | "name": "stdout", 97 | "output_type": "stream", 98 | "text": [ 99 | "50.0\n", 100 | "0.04\n", 101 | "50.0\n", 102 | "0.04\n", 103 | "50.0\n", 104 | "0.04\n", 105 | "50.0\n", 106 | "0.04\n", 107 | "50.0\n", 108 | "0.04\n", 109 | "50.0\n", 110 | "0.04\n", 111 | "50.0\n", 112 | "0.04\n" 113 | ] 114 | } 115 | ], 116 | "source": [ 117 | "# 选择教室标签加下拉菜单\n", 118 | "choose_classroom = tk.Label(window, text=\"选择教室\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=1, sticky='w')\n", 119 | "class_room = tk.StringVar()\n", 120 | "class_room_chosen = ttk.Combobox(window, width=20, height=10, textvariable=class_room, state='readonly')\n", 121 | "class_room_chosen['values'] = room_name\n", 122 | "class_room_chosen.grid(column=0, row=1, sticky='e')\n", 123 | "\n", 124 | "# 选择课时标签加下拉菜单\n", 125 | "choose_time = tk.Label(window, text=\"选择课时\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=2, sticky='w')\n", 126 | "course_time = tk.StringVar()\n", 127 | "course_time_chosen = ttk.Combobox(window, width=20, height=10, textvariable=course_time, state='readonly')\n", 128 | "course_time_chosen['values'] = time_name\n", 129 | "course_time_chosen.grid(column=0, row=2, sticky='e')\n", 130 | "\n", 131 | "pic_tip = tk.Label(window, text=\"所选教室时实图像\", width=16, height=2, font=(\"黑体\", 12)).grid(column=1, row=2, sticky='s')\n", 132 | "\n", 133 | "img = r'C:\\Users\\10485\\Desktop\\head_detecting\\faces\\1.jpg'\n", 134 | "img_open = Image.open(img)\n", 135 | "# 显示图片的代码\n", 136 | "(x, y) = img_open.size # read image size\n", 137 | "x_s = 200 # define standard width\n", 138 | "y_s = y * x_s // x # calc height based on standard width\n", 139 | "img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 140 | "img_png = ImageTk.PhotoImage(img_adj)\n", 141 | "\n", 142 | "Image2 = tk.Label(window, bg='white', bd=20, height=y_s * 0.83, width=x_s * 0.83,\n", 143 | " image=img_png) ##0.83用来消除白框\n", 144 | "Image2.grid(column=1, row=4, sticky='w')\n", 145 | "\n", 146 | "flag = IntVar()\n", 147 | "flag.set(0)\n", 148 | "\n", 149 | "'''\n", 150 | " if(flag.get()!=0):\n", 151 | " pic_path = str(flag.get())+'.jpg'\n", 152 | "\n", 153 | " img_open = Image.open(img)\n", 154 | " # 显示图片的代码\n", 155 | " (x, y) = img_open.size # read image size\n", 156 | " x_s = 200 # define standard width\n", 157 | " y_s = y * x_s // x # calc height based on standard width\n", 158 | " img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 159 | " img_png = ImageTk.PhotoImage(img_adj)\n", 160 | " Image2 = tk.Label(window, bg='black', bd=20, height=y_s * 0.83, width=x_s * 0.83, imagevariable=img_png) ##0.83用来消除白框\n", 161 | " Image2.grid(column=1, row=4, sticky='w')\n", 162 | "'''\n", 163 | "face = 0\n", 164 | "\n", 165 | "\n", 166 | "def rate_cal():\n", 167 | " path = r'C:\\Users\\10485\\Desktop\\head_detecting\\py_excel.xlsx'\n", 168 | " data = xlrd.open_workbook(path)\n", 169 | " sheet1 = data.sheet_by_name('Sheet1')\n", 170 | " nrows = sheet1.nrows # 行\n", 171 | " ncols = sheet1.ncols # 列\n", 172 | " total = 0\n", 173 | " for i in range(nrows):\n", 174 | " if (sheet1.cell(i, 0).value == class_room_chosen.get() and sheet1.cell(i, 1).value == course_time_chosen.get()):\n", 175 | " total = sheet1.cell(i, 2).value\n", 176 | " print(total)\n", 177 | " global rate\n", 178 | " rate = face / total\n", 179 | " print(rate)\n", 180 | "\n", 181 | "\n", 182 | "\n", 183 | "def pic_re():\n", 184 | " if (flag.get() == 0):\n", 185 | " pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg'\n", 186 | " img = os.path.join(r'C:\\Users\\10485\\Desktop\\head_detecting\\faces', pic_path)\n", 187 | " img_open = Image.open(img)\n", 188 | " # 显示图片的代码\n", 189 | " (x, y) = img_open.size # read image size\n", 190 | " global x_s\n", 191 | " global y_s\n", 192 | " x_s = 200 # define standard width\n", 193 | " y_s = y * x_s // x # calc height based on standard width\n", 194 | " img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 195 | " global img_png ##这里一定要设置为全局变量,不然图片无法正常显示!!!!!!!!!!!\n", 196 | " img_png = ImageTk.PhotoImage(img_adj)\n", 197 | " Image2.configure(image=img_png)\n", 198 | " window.update_idletasks()\n", 199 | "\n", 200 | "\n", 201 | "def inspect():\n", 202 | " str1 = \"教室\"\n", 203 | " str2 = \"课上的抬头人数为:\"\n", 204 | " path = r'C:\\Users\\10485\\Desktop\\head_detecting\\faces'\n", 205 | " pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg'\n", 206 | " p = path +'/'+pic_path\n", 207 | " img = cv2.imread(p)\n", 208 | " color = (0, 255, 0)\n", 209 | "\n", 210 | " grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n", 211 | "\n", 212 | " classfier = cv2.CascadeClassifier(\n", 213 | " r\"C:\\Users\\10485\\Desktop\\head_detecting\\haarcascade_frontalface_alt2.xml\")\n", 214 | " faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32))\n", 215 | " a = len(faceRects)\n", 216 | " global face\n", 217 | " face = a\n", 218 | " str3 = str(a)\n", 219 | " var.set(class_room_chosen.get() + str1 + course_time.get() + str2 + str3)\n", 220 | "\n", 221 | "\n", 222 | "var = tk.StringVar() # tkinter中的字符串\n", 223 | "display = tk.Label(window, textvariable=var, font=('Arial', 12), width=38, height=10)\n", 224 | "display.grid(column=0, row=4, sticky='n')\n", 225 | "\n", 226 | "# Adding a Button\n", 227 | "b = ttk.Button(window, text=\"Click Me!\", command=inspect)\n", 228 | "b.grid(column=0, row=4)\n", 229 | "\n", 230 | "rate_button = ttk.Button(window, text=\"Get_rate\", command=rate_cal).grid(column=0, row=6)\n", 231 | "\n", 232 | "pic_button = ttk.Button(window, text=\"Updata picture\", command=pic_re).grid(column=0, row=5)\n", 233 | "window.mainloop()" 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": null, 239 | "metadata": {}, 240 | "outputs": [], 241 | "source": [] 242 | } 243 | ], 244 | "metadata": { 245 | "kernelspec": { 246 | "display_name": "Python 3", 247 | "language": "python", 248 | "name": "python3" 249 | }, 250 | "language_info": { 251 | "codemirror_mode": { 252 | "name": "ipython", 253 | "version": 3 254 | }, 255 | "file_extension": ".py", 256 | "mimetype": "text/x-python", 257 | "name": "python", 258 | "nbconvert_exporter": "python", 259 | "pygments_lexer": "ipython3", 260 | "version": "3.8.3" 261 | } 262 | }, 263 | "nbformat": 4, 264 | "nbformat_minor": 4 265 | } 266 | -------------------------------------------------------------------------------- /code0_initial.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "# !/usr/bin/python\n", 10 | "# The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt\n", 11 | "#\n", 12 | "# This example shows how to run a CNN based face detector using dlib. The\n", 13 | "# example loads a pretrained model and uses it to find faces in images. The\n", 14 | "# CNN model is much more accurate than the HOG based model shown in the\n", 15 | "# face_detector.py example, but takes much more computational power to\n", 16 | "# run, and is meant to be executed on a GPU to attain reasonable speed.\n", 17 | "#\n", 18 | "# You can download the pre-trained model from:\n", 19 | "# http://dlib.net/files/mmod_human_face_detector.dat.bz2\n", 20 | "#\n", 21 | "# The examples/faces folder contains some jpg images of people. You can run\n", 22 | "# this program on them and see the detections by executing the\n", 23 | "# following command:\n", 24 | "# ./cnn_face_detector.py mmod_human_face_detector.dat ../examples/faces/*.jpg\n", 25 | "#\n", 26 | "#\n", 27 | "# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE\n", 28 | "# You can install dlib using the command:\n", 29 | "# pip install dlib\n", 30 | "#\n", 31 | "# Alternatively, if you want to compile dlib yourself then go into the dlib\n", 32 | "# root folder and run:\n", 33 | "# python setup.py install\n", 34 | "# or\n", 35 | "# python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA\n", 36 | "# if you have a CPU that supports AVX instructions, you have an Nvidia GPU\n", 37 | "# and you have CUDA installed since this makes things run *much* faster.\n", 38 | "#\n", 39 | "# Compiling dlib should work on any operating system so long as you have\n", 40 | "# CMake and boost-python installed. On Ubuntu, this can be done easily by\n", 41 | "# running the command:\n", 42 | "# sudo apt-get install libboost-python-dev cmake\n", 43 | "#\n", 44 | "# Also note that this example requires scikit-image which can be installed\n", 45 | "# via the command:\n", 46 | "# pip install scikit-image\n", 47 | "# Or downloaded from http://scikit-image.org/download.html." 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": 2, 53 | "metadata": {}, 54 | "outputs": [ 55 | { 56 | "ename": "ModuleNotFoundError", 57 | "evalue": "No module named 'dlib'", 58 | "output_type": "error", 59 | "traceback": [ 60 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 61 | "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", 62 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtkinter\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mttk\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mdlib\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mskimage\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mio\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtkinter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfiledialog\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0maskopenfilename\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", 63 | "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'dlib'" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "import tkinter as tk\n", 69 | "import time\n", 70 | "from tkinter import ttk\n", 71 | "import sys\n", 72 | "import dlib\n", 73 | "from skimage import io\n", 74 | "from tkinter.filedialog import askopenfilename" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "window = tk.Tk() # 这是一个窗口object\n", 84 | "window.title('抬头率监测系统')\n", 85 | "window.geometry('600x400') # 窗口大小" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": null, 91 | "metadata": {}, 92 | "outputs": [], 93 | "source": [ 94 | "def gettime(): # 当前时间显示\n", 95 | " timestr = time.strftime('%Y.%m.%d %H:%M', time.localtime(time.time()))\n", 96 | " lb.configure(text=timestr)\n", 97 | " window.after(1000, gettime)" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": null, 103 | "metadata": {}, 104 | "outputs": [], 105 | "source": [ 106 | "#动态选择图片\n", 107 | "def choosepic():\n", 108 | " path_=askopenfilename()\n", 109 | " path.set(path_)\n", 110 | " img_gif=Tkinter.PhotoImage(file=r'C:\\Users\\86132\\Desktop\\dlib\\dlib-master\\examples\\faces\\1.jpg')\n", 111 | " l1.config(image=img_gif)\n" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": null, 117 | "metadata": {}, 118 | "outputs": [], 119 | "source": [ 120 | "# 检测人脸数核心函数\n", 121 | "def inspect():\n", 122 | " str1 = \"教室\"\n", 123 | " str2 = \"课上的抬头人数为:\"\n", 124 | "\n", 125 | " sys_argv=[r'C:\\Users\\86132\\Desktop\\dlib\\dlib_data\\mmod_human_face_detector.dat',\n", 126 | " r'C:\\Users\\86132\\Desktop\\dlib\\dlib-master\\examples\\faces\\1.jpg',\n", 127 | " r'C:\\Users\\86132\\Desktop\\dlib\\dlib-master\\examples\\faces\\3.jpg']\n", 128 | " '''\n", 129 | " if len(sys.argv) < 3: # 如果检测输入的参数不够标准的三个,提示去获取模型文件\n", 130 | " print(\n", 131 | " \"Call this program like this:\\n\"\n", 132 | " \" ./cnn_face_detector.py mmod_human_face_detector.dat ../examples/faces/*.jpg\\n\"\n", 133 | " \"You can get the mmod_human_face_detector.dat file from:\\n\"\n", 134 | " \" http://dlib.net/files/mmod_human_face_detector.dat.bz2\")\n", 135 | " exit()\n", 136 | " '''\n", 137 | " cnn_face_detector = dlib.cnn_face_detection_model_v1(sys_argv[0]) # 调用cnn_face_detection模型\n", 138 | "\n", 139 | " # win = dlib.image_window()\n", 140 | "\n", 141 | " for f in sys_argv[2:]: # 处理sys.argv[2]地址处的图片\n", 142 | " print(\"Processing file: {}\".format(f))\n", 143 | " img = io.imread(f)\n", 144 | " # The 1 in the second argument indicates that we should upsample the image\n", 145 | " # 1 time. This will make everything bigger and allow us to detect more\n", 146 | " # faces.\n", 147 | " dets = (img, 1) # 待改\n", 148 | " #dets = cnn_face_detector(img, 1) # img中所有检测到的脸的数组\n", 149 | " '''cnn_face_detector\n", 150 | " This detector returns a mmod_rectangles object. This object contains a list of mmod_rectangle objects.\n", 151 | " These objects can be accessed by simply iterating over the mmod_rectangles object\n", 152 | " The mmod_rectangle object has two member variables, a dlib.rectangle object, and a confidence score.\n", 153 | "\n", 154 | " It is also possible to pass a list of images to the detector.\n", 155 | " - like this: dets = cnn_face_detector([image list], upsample_num, batch_size = 128)\n", 156 | " In this case it will return a mmod_rectangless object.\n", 157 | " This object behaves just like a list of lists and can be iterated over.\n", 158 | " '''\n", 159 | " a = len(dets)\n", 160 | " str3 = str(a)\n", 161 | " var.set(class_room_chosen.get() + str1 + course_time.get() + str2 + str3)\n", 162 | " # print(\"Number of faces detected: {}\".format(len(dets)))\n", 163 | " # for i, d in enumerate(dets):\n", 164 | " # print(\"Detection {}: Left: {} Top: {} Right: {} Bottom: {} Confidence: {}\".format(\n", 165 | " # i, d.rect.left(), d.rect.top(), d.rect.right(), d.rect.bottom(), d.confidence))\n", 166 | "\n", 167 | " # rects = dlib.rectangles()\n", 168 | " # rects.extend([d.rect for d in dets])\n", 169 | "\n", 170 | " # win.clear_overlay()\n", 171 | " # win.set_image(img)\n", 172 | " # win.add_overlay(rects)\n", 173 | " # dlib.hit_enter_to_continue()\n" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": null, 179 | "metadata": {}, 180 | "outputs": [], 181 | "source": [ 182 | "lb = tk.Label(window, text='', font=(\"黑体\", 20))\n", 183 | "lb.grid(column=0, row=0)\n", 184 | "gettime()\n", 185 | "\n", 186 | "# 选择教室标签加下拉菜单\n", 187 | "choose_classroom = tk.Label(window, text=\"选择教室\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=1, sticky='w')\n", 188 | "class_room = tk.StringVar()\n", 189 | "class_room_chosen = ttk.Combobox(window, width=20, height=10, textvariable=class_room, state='readonly')\n", 190 | "class_room_chosen['values'] = ('N101', 'N103', 'S101', 'S103')\n", 191 | "class_room_chosen.grid(column=1, row=1, sticky='w')\n", 192 | "\n", 193 | "# 选择课时标签加下拉菜单\n", 194 | "choose_time = tk.Label(window, text=\"选择课时\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=3, sticky='w')\n", 195 | "course_time = tk.StringVar()\n", 196 | "course_time_chosen = ttk.Combobox(window, width=20, height=10, textvariable=course_time, state='readonly')\n", 197 | "course_time_chosen['values'] = (\"周一一二节\", \"周一三四节\", \"周一五六节\", \"周一七八节\")\n", 198 | "course_time_chosen.grid(column=1, row=3, sticky='w')" 199 | ] 200 | }, 201 | { 202 | "cell_type": "code", 203 | "execution_count": null, 204 | "metadata": {}, 205 | "outputs": [], 206 | "source": [ 207 | "var = tk.StringVar() # tkinter中的字符串\n", 208 | "display = tk.Label(window, textvariable=var, font=('Arial', 12), width=38, height=10)\n", 209 | "display.grid(column=1, row=5, sticky='w')\n", 210 | "\n", 211 | "# Adding a Button\n", 212 | "b = ttk.Button(window, text=\"Click Me!\", command=inspect)\n", 213 | "b.grid(column=0, row=5)\n", 214 | "\n", 215 | "window.mainloop()" 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "execution_count": null, 221 | "metadata": {}, 222 | "outputs": [], 223 | "source": [] 224 | }, 225 | { 226 | "cell_type": "code", 227 | "execution_count": null, 228 | "metadata": {}, 229 | "outputs": [], 230 | "source": [] 231 | } 232 | ], 233 | "metadata": { 234 | "kernelspec": { 235 | "display_name": "Python 3", 236 | "language": "python", 237 | "name": "python3" 238 | }, 239 | "language_info": { 240 | "codemirror_mode": { 241 | "name": "ipython", 242 | "version": 3 243 | }, 244 | "file_extension": ".py", 245 | "mimetype": "text/x-python", 246 | "name": "python", 247 | "nbconvert_exporter": "python", 248 | "pygments_lexer": "ipython3", 249 | "version": "3.8.3" 250 | } 251 | }, 252 | "nbformat": 4, 253 | "nbformat_minor": 4 254 | } 255 | -------------------------------------------------------------------------------- /code2_password_final.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import cv2\n", 10 | "import numpy as np\n", 11 | "import sys, os, glob, numpy\n", 12 | "from skimage import io\n", 13 | "from PIL import Image, ImageTk\n", 14 | "import tkinter as tk\n", 15 | "import time\n", 16 | "from tkinter import ttk\n", 17 | "from tkinter import IntVar\n", 18 | "import xlrd" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 2, 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "##登录界面\n", 28 | "root = tk.Tk()\n", 29 | "root.title('欢迎进入北邮抬头率检测系统!')\n", 30 | "root.geometry('600x420')\n", 31 | "#增加背景图片\n", 32 | "img = Image.open(r\"C:\\Users\\10485\\Desktop\\head_detecting\\bupt.jpg\")\n", 33 | "img2 = img.resize((600, 420), Image.ANTIALIAS)\n", 34 | "photo = ImageTk.PhotoImage(img2)\n", 35 | "theLabel = tk.Label(root,\n", 36 | " text=\"\",#内容\n", 37 | " justify=tk.LEFT,#对齐方式\n", 38 | " image=photo,#加入图片\n", 39 | " compound = tk.CENTER,#关键:设置为背景图片\n", 40 | " font=(\"华文行楷\",20),#字体和字号\n", 41 | " fg = \"white\")#前景色\n", 42 | "theLabel.place(x=0,y=0)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 3, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "##主窗口\n", 52 | "def get_in():\n", 53 | " # GUI代码\n", 54 | " root.destroy()\n", 55 | " window = tk.Tk() # 这是一个窗口object\n", 56 | " window.title('抬头率监测系统')\n", 57 | " window.geometry('600x400') # 窗口大小\n", 58 | "\n", 59 | " def read_data():\n", 60 | " path = r'.\\py_excel.xlsx'\n", 61 | "\n", 62 | " # 打开文件\n", 63 | " data = xlrd.open_workbook(path)\n", 64 | " # path + '/' +file 是文件的完整路径\n", 65 | " # 获取表格数目\n", 66 | " # nums = len(data.sheets())\n", 67 | " # for i in range(nums):\n", 68 | " # # 根据sheet顺序打开sheet\n", 69 | " # sheet1 = data.sheets()[i]\n", 70 | "\n", 71 | " # 根据sheet名称获取\n", 72 | " sheet1 = data.sheet_by_name('Sheet1')\n", 73 | " sheet2 = data.sheet_by_name('Sheet2')\n", 74 | " # 获取sheet(工作表)行(row)、列(col)数\n", 75 | " nrows = sheet1.nrows # 行\n", 76 | " ncols = sheet1.ncols # 列\n", 77 | " # print(nrows, ncols)\n", 78 | "\n", 79 | " # 获取教室名称列表\n", 80 | " global room_name, time_name\n", 81 | " room_name = sheet2.col_values(0)\n", 82 | " time_name = sheet2.col_values(1)\n", 83 | " print(room_name)\n", 84 | " print(time_name)\n", 85 | " # 获取单元格数据\n", 86 | " # 1.cell(单元格)获取\n", 87 | " # cell_A1 = sheet2.cell(0, 0).value\n", 88 | " # print(cell_A1)\n", 89 | " # 2.使用行列索引\n", 90 | " # cell_A2 = sheet2.row(0)[1].value\n", 91 | "\n", 92 | " read_data()\n", 93 | "\n", 94 | " def gettime(): # 当前时间显示\n", 95 | " timestr = time.strftime('%Y.%m.%d %H:%M', time.localtime(time.time()))\n", 96 | " lb.configure(text=timestr)\n", 97 | " window.after(1000, gettime)\n", 98 | "\n", 99 | " lb = tk.Label(window, text='', font=(\"黑体\", 20))\n", 100 | " lb.grid(column=0, row=0)\n", 101 | " gettime()\n", 102 | "\n", 103 | " # 选择教室标签加下拉菜单\n", 104 | " choose_classroom = tk.Label(window, text=\"选择教室\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=1,\n", 105 | " sticky='w')\n", 106 | " class_room = tk.StringVar()\n", 107 | " class_room_chosen = ttk.Combobox(window, width=20, height=10, textvariable=class_room, state='readonly')\n", 108 | " class_room_chosen['values'] = room_name\n", 109 | " class_room_chosen.grid(column=0, row=1, sticky='e')\n", 110 | "\n", 111 | " # 选择课时标签加下拉菜单\n", 112 | " choose_time = tk.Label(window, text=\"选择课时\", width=15, height=2, font=(\"黑体\", 12)).grid(column=0, row=2, sticky='w')\n", 113 | " course_time = tk.StringVar()\n", 114 | " course_time_chosen = ttk.Combobox(window, width=20, height=10, textvariable=course_time, state='readonly')\n", 115 | " course_time_chosen['values'] = time_name\n", 116 | " course_time_chosen.grid(column=0, row=2, sticky='e')\n", 117 | "\n", 118 | " pic_tip = tk.Label(window, text=\"所选教室时实图像\", width=16, height=2, font=(\"黑体\", 12)).grid(column=1, row=2, sticky='s')\n", 119 | "\n", 120 | " img = r'.\\faces\\start.jpg'##初始化图片界面\n", 121 | " img_open = Image.open(img)\n", 122 | " # 显示图片的代码\n", 123 | " (x, y) = img_open.size # read image size\n", 124 | " x_s = 200 # define standard width\n", 125 | " y_s = y * x_s // x # calc height based on standard width\n", 126 | " img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 127 | " img_png = ImageTk.PhotoImage(img_adj)\n", 128 | "\n", 129 | " Image2 = tk.Label(window, bg='white', bd=20, height=y_s * 0.83, width=x_s * 0.83,\n", 130 | " image=img_png) ##0.83用来消除白框\n", 131 | " Image2.grid(column=1, row=4, sticky='w')\n", 132 | "\n", 133 | " flag = IntVar()\n", 134 | " flag.set(0)\n", 135 | "\n", 136 | " '''\n", 137 | " if(flag.get()!=0):\n", 138 | " pic_path = str(flag.get())+'.jpg'\n", 139 | "\n", 140 | " img_open = Image.open(img)\n", 141 | " # 显示图片的代码\n", 142 | " (x, y) = img_open.size # read image size\n", 143 | " x_s = 200 # define standard width\n", 144 | " y_s = y * x_s // x # calc height based on standard width\n", 145 | " img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 146 | " img_png = ImageTk.PhotoImage(img_adj)\n", 147 | " Image2 = tk.Label(window, bg='black', bd=20, height=y_s * 0.83, width=x_s * 0.83, imagevariable=img_png) ##0.83用来消除白框\n", 148 | " Image2.grid(column=1, row=4, sticky='w')\n", 149 | " '''\n", 150 | "\n", 151 | " def rate_cal():\n", 152 | " face = 0\n", 153 | "\n", 154 | " def inspect(): ##将人脸检测函数内嵌\n", 155 | " nonlocal face\n", 156 | " str1 = \"教室\"\n", 157 | " str2 = \"课上的抬头率为:\"\n", 158 | " path = r'.\\faces'\n", 159 | " pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg'\n", 160 | " p = path + '/' + pic_path\n", 161 | " img = cv2.imread(p)\n", 162 | " color = (0, 255, 0)\n", 163 | "\n", 164 | " grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n", 165 | "\n", 166 | " classfier = cv2.CascadeClassifier(\n", 167 | " r\".\\haarcascade_frontalface_alt2.xml\")\n", 168 | " faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32))\n", 169 | " a = len(faceRects)\n", 170 | " face = a\n", 171 | " str3 = str(a)\n", 172 | " inspect()\n", 173 | " path = r'.\\py_excel.xlsx'\n", 174 | " data = xlrd.open_workbook(path)\n", 175 | " sheet1 = data.sheet_by_name('Sheet1')\n", 176 | " nrows = sheet1.nrows # 行\n", 177 | " ncols = sheet1.ncols # 列\n", 178 | " total = 0\n", 179 | " for i in range(nrows):\n", 180 | " if (sheet1.cell(i, 0).value == class_room_chosen.get() and sheet1.cell(i,\n", 181 | " 1).value == course_time_chosen.get()):\n", 182 | " total = sheet1.cell(i, 2).value\n", 183 | " print(total)\n", 184 | " global rate\n", 185 | " print(face)\n", 186 | " rate = face /total\n", 187 | " print(rate)\n", 188 | " str1 = \"教室\"\n", 189 | " str2 = \"课上的抬头率为:\"\n", 190 | " str3 = str(rate)\n", 191 | " var.set(class_room_chosen.get() + str1 + course_time.get() + str2 + str3)\n", 192 | "\n", 193 | " def pic_re():\n", 194 | " if (flag.get() == 0):\n", 195 | " pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg'\n", 196 | " img = os.path.join(r'.\\faces', pic_path) #图片的命名需按规则来命名,具体规则可参考示例图片名称\n", 197 | " img_open = Image.open(img)\n", 198 | " # 显示图片的代码\n", 199 | " (x, y) = img_open.size # read image size\n", 200 | " global x_s\n", 201 | " global y_s\n", 202 | " x_s = 200 # define standard width\n", 203 | " y_s = y * x_s // x # calc height based on standard width\n", 204 | " img_adj = img_open.resize((x_s, y_s), Image.ANTIALIAS)\n", 205 | " global img_png ##这里一定要设置为全局变量,不然图片无法正常显示!!!!!!!!!!!\n", 206 | " img_png = ImageTk.PhotoImage(img_adj)\n", 207 | " Image2.configure(image=img_png)\n", 208 | " window.update_idletasks()\n", 209 | "\n", 210 | "\n", 211 | " var = tk.StringVar() # tkinter中的字符串\n", 212 | " display = tk.Label(window, textvariable=var, font=('Arial', 12), width=38, height=10)\n", 213 | " display.grid(column=0, row=4, sticky='n')\n", 214 | "\n", 215 | " # Adding a Button\n", 216 | " rate_button = ttk.Button(window, text=\"Get_rate\", command=rate_cal).grid(column=0, row=4, sticky='s')\n", 217 | "\n", 218 | " pic_button = ttk.Button(window, text=\"Updata picture\", command=pic_re).grid(column=0, row=5)\n", 219 | " window.mainloop()" 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": 4, 225 | "metadata": {}, 226 | "outputs": [ 227 | { 228 | "name": "stdout", 229 | "output_type": "stream", 230 | "text": [ 231 | "['N101', 'N102', 'N103', 'N104', 'N105', 'N106', 'N107', 'N108', 'N109', 'N110', 'N111', 'N112', 'N113', 'N114', 'N115', 'N116', 'N201', 'N202', 'N203', 'N204']\n", 232 | "['Monday_1_2', 'Monday_3_4', 'Monday_5_6', 'Monday_7_8', 'Tuesday_1_2', 'Tuesday_3_4', 'Tuesday_5_6', 'Tuesday_7_8', 'Wednesday_1_2', 'Wednesday_3_4', 'Wednesday_5_6', 'Wednesday_7_8', 'Thursday_1_2', 'Thursday_3_4', 'Thursday_5_6', 'Thursday_7_8', 'Friday_1_2', 'Friday_3_4', 'Friday_5_6', 'Friday_7_8']\n", 233 | "5.0\n", 234 | "4\n", 235 | "0.8\n" 236 | ] 237 | } 238 | ], 239 | "source": [ 240 | "name = tk.Label(root, text=\"请输入用户名:\", width=16, height=1)\n", 241 | "name.place(x=50, y=220)\n", 242 | "name_tap = tk.Entry(root, width=16)\n", 243 | "name_tap.place(x=250, y=220)\n", 244 | "\n", 245 | "code = tk.Label(root, text=\"请输入密码:\", width=16, height=1)\n", 246 | "code.place(x=50, y=250)\n", 247 | "code_tap = tk.Entry(root, width=16)\n", 248 | "code_tap.place(x=250, y=250)\n", 249 | "\n", 250 | "\n", 251 | "get_into = ttk.Button(root, text='登录', command=get_in).place(x=250,y=300)\n", 252 | "root.mainloop()\n", 253 | "\n" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": null, 259 | "metadata": {}, 260 | "outputs": [], 261 | "source": [] 262 | } 263 | ], 264 | "metadata": { 265 | "kernelspec": { 266 | "display_name": "Python 3", 267 | "language": "python", 268 | "name": "python3" 269 | }, 270 | "language_info": { 271 | "codemirror_mode": { 272 | "name": "ipython", 273 | "version": 3 274 | }, 275 | "file_extension": ".py", 276 | "mimetype": "text/x-python", 277 | "name": "python", 278 | "nbconvert_exporter": "python", 279 | "pygments_lexer": "ipython3", 280 | "version": "3.8.3" 281 | } 282 | }, 283 | "nbformat": 4, 284 | "nbformat_minor": 4 285 | } 286 | -------------------------------------------------------------------------------- /faces/training_with_face_landmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Training faces 5 | These are images from the PASCAL VOC 2011 dataset. 6 | The face landmarks are from dlib's shape_predictor_68_face_landmarks.dat 7 | landmarking model. The model uses the 68 landmark scheme used by the iBUG 8 | 300-W dataset. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | -------------------------------------------------------------------------------- /faces/testing_with_face_landmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Testing faces 5 | These are images from the PASCAL VOC 2011 dataset. 6 | The face landmarks are from dlib's shape_predictor_68_face_landmarks.dat 7 | landmarking model. The model uses the 68 landmark scheme used by the iBUG 8 | 300-W dataset. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | 1311 | 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | 1363 | 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1372 | 1373 | 1374 | 1375 | 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | 1418 | 1419 | 1420 | 1421 | 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | 1441 | 1442 | 1443 | 1444 | 1445 | 1446 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | 1463 | 1464 | 1465 | 1466 | 1467 | 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1489 | 1490 | 1491 | 1492 | 1493 | 1494 | 1495 | 1496 | 1497 | 1498 | 1499 | 1500 | 1501 | 1502 | 1503 | 1504 | 1505 | 1506 | 1507 | 1508 | 1509 | 1510 | 1511 | 1512 | 1513 | 1514 | 1515 | 1516 | 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | 1523 | 1524 | 1525 | 1526 | 1527 | 1528 | 1529 | 1530 | 1531 | 1532 | 1533 | 1534 | 1535 | 1536 | 1537 | 1538 | 1539 | 1540 | 1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | 1554 | 1555 | 1556 | 1557 | 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1564 | 1565 | 1566 | 1567 | 1568 | 1569 | 1570 | 1571 | 1572 | 1573 | 1574 | 1575 | 1576 | 1577 | 1578 | 1579 | 1580 | 1581 | 1582 | 1583 | 1584 | 1585 | 1586 | 1587 | 1588 | 1589 | 1590 | 1591 | 1592 | 1593 | 1594 | 1595 | 1596 | 1597 | 1598 | 1599 | 1600 | 1601 | 1602 | 1603 | 1604 | 1605 | 1606 | 1607 | 1608 | 1609 | 1610 | 1611 | 1612 | 1613 | 1614 | 1615 | 1616 | 1617 | 1618 | 1619 | 1620 | 1621 | 1622 | 1623 | 1624 | 1625 | 1626 | 1627 | 1628 | 1629 | 1630 | 1631 | 1632 | 1633 | 1634 | 1635 | 1636 | 1637 | 1638 | 1639 | 1640 | 1641 | 1642 | 1643 | 1644 | 1645 | 1646 | 1647 | 1648 | 1649 | 1650 | 1651 | 1652 | 1653 | 1654 | 1655 | 1656 | 1657 | 1658 | 1659 | 1660 | 1661 | 1662 | 1663 | 1664 | 1665 | 1666 | 1667 | 1668 | 1669 | 1670 | 1671 | 1672 | 1673 | 1674 | 1675 | 1676 | 1677 | 1678 | 1679 | 1680 | 1681 | 1682 | 1683 | 1684 | 1685 | 1686 | 1687 | 1688 | 1689 | 1690 | 1691 | 1692 | 1693 | 1694 | 1695 | 1696 | 1697 | 1698 | 1699 | 1700 | 1701 | 1702 | 1703 | 1704 | 1705 | 1706 | 1707 | 1708 | 1709 | 1710 | 1711 | 1712 | 1713 | 1714 | 1715 | 1716 | 1717 | 1718 | 1719 | 1720 | 1721 | 1722 | 1723 | 1724 | 1725 | 1726 | 1727 | 1728 | 1729 | 1730 | 1731 | 1732 | 1733 | 1734 | 1735 | 1736 | 1737 | 1738 | 1739 | 1740 | 1741 | 1742 | 1743 | 1744 | 1745 | 1746 | 1747 | 1748 | 1749 | 1750 | 1751 | 1752 | 1753 | 1754 | 1755 | 1756 | 1757 | 1758 | 1759 | 1760 | 1761 | 1762 | 1763 | 1764 | 1765 | 1766 | 1767 | 1768 | 1769 | 1770 | 1771 | 1772 | 1773 | --------------------------------------------------------------------------------