HUB
Sign inSign up

faceplugin/face-liveness

By faceplugin

•Updated 1 day ago

On-premise passive face liveness (PAD) HTTP API. Linux amd64. Port 8093.

Image
0

811

faceplugin/face-liveness repository overview

⁠FacePlugin Face Liveness

On-premise passive face liveness (PAD) HTTP API. Linux amd64. CPU only. Official image: faceplugin/face-liveness⁠.

The image is an API/SDK server only (no Gradio). The runtime is already inside — pull and run. This repository is self-contained.

This is the Face Liveness product, not Face Liveness Check / Face Verification (faceplugin/face-verification) and not the divi image (faceplugin/face-liveness-divi).

⁠What it does

Fully on-premise anti-spoofing for KYC. One RGB photo, nothing asked of the person: printed photo, screen replay (photo and video), 3D mask, and deepfake. All processing stays on your server.

Score ≥ 0.5 → result: "Real", pass: true. Score < 0.5 → result: "Spoof", pass: false.

Passive mode at that threshold, FacePlugin QA following ISO/IEC 30107-3: BPCER 0% (none observed) and APCER 0.5–1.5% against printed photo, screen replay (photo and video), and a painted 3D resin mask. This is an internal evaluation, not an independent laboratory result, and no iBeta certification is claimed. A 0% BPCER means none observed, not a rate of zero.

⁠Tags

Every tag is the same CPU image.

TagNotes
latestSame image as latest-cpu
latest-cpuCurrent CPU image
2.0.0Same image as 2.0.0-cpu
2.0.0-cpuVersion 2.0.0 CPU image
docker pull faceplugin/face-liveness:latest

⁠Quick start

Default listen port 8093. Use --shm-size=2gb (the SDK unpacks models into shared memory; Docker’s 64MB default is too small).

docker run -d --name faceplugin-face-liveness \
  --shm-size=2gb --privileged \
  -p 8093:8093 \
  -v /etc/machine-id:/etc/machine-id:ro \
  faceplugin/face-liveness:latest

docker logs -f faceplugin-face-liveness
# Look for the machine code line: FPMC1.…

API: http://127.0.0.1:8093

The image refuses to start without that command. A plain docker run keeps the container's own /etc/machine-id, so the license machine code is not the host's. --shm-size=2gb and --privileged are required too. This image is for a Linux host that has /etc/machine-id.

You do not need a license to start. GET /api/health works before activation. Product endpoints unlock after you activate.

⁠License

The published image does not include a license. The API starts without one and prints a machine code (FPMC1.…).

  1. Copy the machine code from the logs, or GET /api/machinecode.
  2. Send that code to FacePlugin. You receive a license key (FP1.…).
  3. Activate:
# Paste the FP1. key into license.txt, then:
curl -s -X POST http://127.0.0.1:8093/api/activate \
  -H 'Content-Type: text/plain' \
  --data-binary @license.txt

Or mount a file the process reads on startup:

-v $(pwd)/license.txt:/root/facesdk/license.txt

Docker and native-host codes are different. If you run in Docker, send the Docker machine code. On a Linux host the code comes from /etc/machine-id; keep that volume so a recreate still matches the key.

A key labelled Liveness only or Recognition + Liveness unlocks /api/liveness. A Recognition only key does not.

curl -s http://127.0.0.1:8093/api/licenseStatus

⁠Several containers, one license

Use a new name and host port, and keep the same machine-id mount:

docker run -d --name faceplugin-face-liveness-2 \
  --shm-size=2gb --privileged \
  -p 8193:8093 \
  -v /etc/machine-id:/etc/machine-id:ro \
  faceplugin/face-liveness:latest

Activate each published port with the same key. Every container must mount the host /etc/machine-id.

More: run multiple containers⁠.

⁠API (after activation)

Routes are /api/*. There is no version segment and no /docs.

MethodPathNotes
GET/api/healthHTTP server is up. No license required
GET/api/machinecodeFPMC1.…
GET/api/licenseStatusWhat the key unlocks
GET/api/backendRuntime that is loaded
POST/api/activateRaw license key (text/plain)
POST/api/livenessJSON {"image":"<base64-jpeg>"}
POST/api/check_livenessAlias of /api/liveness

Health:

curl -s http://127.0.0.1:8093/api/health

Liveness:

curl -s -X POST http://127.0.0.1:8093/api/liveness \
  -H 'Content-Type: application/json' \
  -d '{"image":"<base64-jpeg>"}'

Example success data:

{ "score": 0.72, "result": "Real", "pass": true }

This API has no authentication. It listens on 0.0.0.0 so the published port works, and it answers browser requests from any origin. Put it behind your own gateway before exposing it.

VariablePurpose
FACESDK_BIND_HOSTListen address. Default 0.0.0.0. Set 127.0.0.1 for this machine only
PORT / FACESDK_PORTAPI port. Default 8093
LICENSEA license key (FP1.…) or a path to a license file. Default /root/facesdk/license.txt
FP_NO_LICENSE_PROMPTSet to 1 to skip the interactive paste prompt

Postman collection and the Gradio demo (port 9093) run on the host, not in this image: FaceLivenessDetection-Docker⁠.

Tag summary

Content type

Image

Digest

sha256:ff53620d3…

Size

432 MB

Last updated

1 day ago

docker pull faceplugin/face-liveness