This is a simple web app that uses Face-API.js to demonstrate facial recognition technology.

It's built with Next.js, Prisma and Chakra UI.

Getting Started

App

First, set the SQLite db with Prisma:

yarn prisma migrate dev

Then, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Finally, open http://localhost:3000 with your browser to start testing face recognition.

e0e17c6272987aa0aabf0884fe331e42.mp4

Try demo.mjs

First, install required dependencies:

yarn

Second, generate some referential descriptors (via face-api.js for example) and keep it in features/ folder as .json

ex:

[
  {
    "0": -0.07616627216339111,
    "1": 0.10632248967885971,
    "2": 0.0073056770488619804,
    "3": -0.11107124388217926,
    "4": -0.13152258098125458,
    ...
  },
  {
    "0": -0.1595122516155243,
    "1": 0.14416350424289703,
    "2": 0.0833432748913765,
    "3": -0.14474943280220032,
    "4": -0.15674208104610443,
    ...
  }
]

Finally, generate your query descriptor and store it in a .json file

{
  "0": -0.07616627216339111,
  "1": 0.10632248967885971,
  "2": 0.0073056770488619804,
  "3": -0.11107124388217926,
  "4": -0.13152258098125458,
  ...
}

Then, run:

node --experimental-modules demo.mjs -i features/query-descriptor.json
> Me (0.28)

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.