This project, using faceapi, is a proof-of-concept website.
The HTML files are minimally styled, and minimal directions are provided for page navigation.
Important: This website is not designed for deployment, hence it is not secure by design.
-
Read license terms before proceeding.
-
Clone or download this repository and navigate to its folder.
$ git clone https://github.com/kennethsoh/faceapi-website.git
$ cd faceapi-website
-
Install and set up node.js and mysql server.
-
Install additional required npm modules
$ npm install body-parser express fs multer mysql rimraf
- Set up mysql server, creating 1 database: "logs", and 2 tables: "logs" and "users".
> CREATE DATABASE logs;
> CREATE TABLE IF NOT EXISTS logs.logs (`logid` INT NOT NULL AUTO_INCREMENT,`name` VARCHAR(64) NOT NULL,`date` VARCHAR(64) NOT NULL,PRIMARY KEY (`logid`));
> CREATE TABLE IF NOT EXISTS logs.users (`userid` INT NOT NULL AUTO_INCREMENT,`username` VARCHAR(64) NOT NULL,`password` VARCHAR(64) NOT NULL,`imagelink` VARCHAR(64) NOT NULL,PRIMARY KEY (`userid`));
- Depending on your mysql database setup, edit db_connection.js for the correct user and password.
- Start the node server and check that the database is connected
$ node server.js
Application listening at http://127.0.0.1:3000 ; enter CTRL + C to stop
Database Connected!
- Open a web browser and enter
127.0.0.1:3000
in the url bar. You may need to allow webcam access.
Use of faceapi, implemented on top of tensorflow.js core. This software is able to recognise faces and match them against uploaded images.
Upload your own image for faceapi to recognise you. To do this, register for an account at 127.0.0.1:3000/register
. Login to an exisitng account at 127.0.0.1:3000/login
.
Note: Due to existing limitation, your image needs to be renamed to your username before upload. (i.e. If your username will be 'Alice', rename your image file to 'Alice.jpg'). JPG, JPEG and PNG file types are accepted.
Update your registered image and your password at 127.0.0.1:3000/user
. You will only be able to access this page if there is an existing user session.
You may also remove your image from the web server by deleting your account.