Live demo · ID verification

Compare faces to IDs on Chalk CPUs

This demo shows how to run YuNet and SFace on Chalk CPUs to compare a face with a specimen ID photo and measure head movement. Record a short clip to try it, then explore the code to see how it works.

Compare a matching face with a specimen mismatch

This experiment uses a fictional license and requires camera access when you choose to record.

Try this experiment · expected results

  1. 1Create a matching specimen

    Choose Use my face, allow camera access, then Record & verify and follow the head-turn prompts.

    Expected: Compare the captured face with the specimen and inspect the similarity and motion checks.

  2. 2Try a sample license

    Choose a sample person’s license and record yourself again.

    Expected: The face comparison should distinguish the sample portrait from your own; this is not a real identity approval.

yunet + sfaceOpen in new tab

The CPU models served on Chalk compare a license portrait with video frames. Face similarity and head movement are separate checks; this is a fictional-license demo.

Built on Chalk

Chalk serves the OpenCV models and web app on a two-CPU replica. The example app combines face similarity with a basic head-turn check and returns the scores behind its verdict.

  • Serve models on CPUs

    YuNet and SFace run with OpenCV on a two-CPU Chalk replica. The same replica serves the web app and the face-comparison endpoint.

  • Deploy from Python

    Define the container and its model weights in Python. Later builds can reuse cached image layers.

  • Model weights ready at startup

    Chalk builds both OpenCV model files into the container image. New replicas load those files directly when the server starts.

  • Scores your app can inspect

    The example returns face similarity, the comparison threshold, head-turn range, and per-frame results. These are outputs of the app’s matching logic, ready for your workflow to evaluate.

This is a demo, not an identity product. Its basic head-turn check does not protect against video replays or deepfakes, and face recognition accuracy varies across people, cameras and lighting. Use faces only with consent and follow the biometric privacy laws that apply to you.

Deploy your own

Run it on your own

Clone the example, log in to Chalk, and run the deploy script. Chalk builds the image with both model files, starts a two-CPU replica, and prints the HTTPS URL for your demo.

You will need uv, the Chalk CLI, a Chalk environment, and camera access to record a clip. The included Python client can also send a license image and video file to the comparison API.

chalk-ai/id-verification
git clone https://github.com/chalk-ai/id-verification
cd id-verification

# Or export CHALK_CLIENT_ID and CHALK_CLIENT_SECRET.
chalk login

# Builds the image, starts a CPU replica, prints your demo's URL.
./deploy.py

Serve face-comparison models in your workflow

Build and evaluate identity signals alongside the rest of your application. Talk to an engineer about serving CPU models on Chalk.