Topic 12
If you can't click the link, there is a text
reference below to block the Baidu face recognition api
https://ai.baidu.com/ai-doc/FACE/7k37c1twu
written by
senior https://blog.csdn.net/qq_36752486/article/ details / 88045868 # _Toc22179_WPSOffice_Level1
Source code
Comments are detailed and detailed. The
code specification is better (although still garbage). The
open source address
https://github.com/Duskry/FaceCheck
does not provide an app.
Please package it yourself. Take a look at the source code in use and test the demo.
The main technologies used are face recognition, file reading, database, network IO, image processing
Design situation
UI interface
、
Data design
name | Types of | Is empty | Comment | key | other |
---|---|---|---|---|---|
Id | Integer | no | Logo | PK | Self-increasing |
Account | Text | no | User Account | Usually numbers | |
Name | Text | no | User name | Generally Chinese | |
Pwd | Text | no | account password | Alphanumeric commonly used characters | |
Role | Integer | no | User permission code | 1 student 2 teacher 3 super administrator |
name | Types of | Is empty | Comment | key | other |
---|---|---|---|---|---|
Checkid | Integer | no | Logo | PK | Self-increasing |
Account | Text | no | User Account | Usually numbers | |
Name | Text | no | User name | Generally Chinese | |
Checktime | Time | no | User punch time | Time format example 2019-12-12 09:00:00 |
Main functional modules
A. Account registration and login
Responsible for the main logic of account login and registration. Only match the account password to log in. At the same time, join the authority management.
Show different components for people with different permissions.
B. Face Registration and Recognition
Each account can essentially correspond to multiple faces. Register a face for each account. Faces can be obtained through album import and camera photography. Then upload the face and related information to Baidu's face database.
C. Time and attendance check-in Time and attendance
check-in also need to upload pictures, the way to get pictures can be album or camera. Read the EXIF information of the picture. Proofreading requirements, such as time difference within one hour, location information, etc.
D. Face management
Update the user's face data, or delete the face data
E. Punch information management
You can select the date or account to check the already punched people.
Code structure:
├─main
│ ├─java
│ │ └─com
│ │ └─ren
│ │ └─face
│ │ ├─acitivity
│ │ ├─adapter
│ │ ├─bean
│ │ ├─constant
│ │ ├─dao
│ │ ├─database
│ │ ├─handler
│ │ ├─service
│ │ └─utils
Description:
- The activity package is the main logic of the main interface and the main body of the activity.
- The adapter package is an adapter for displaying views
- The bean defines the POJO class and the result encapsulation class of some network requests
- The constant package is the definition of some constants
- dao is the conversion layer where objects are serialized into database data
- database defines the creation and update of Android-specific SQLite data
- The handler is a callback class for asynchronous requests from the network, which handles what needs to be done after the uploaded image is complete
- The service is mainly related to some network request related classes and the main function to handle face recognition and upload
- utils defines some network, picture tools. Including image compression, image transcoding, network getpost request.
I won't say anything else. You can understand the code