Quickstart
Quickstart
Section titled “Quickstart”Get face recognition working in your app in under 5 minutes.
-
Start the server
Terminal window git clone https://github.com/drinkredwine/openbiometricscd openbiometrics/engine && pip install -e . && python download_models.pycd ../api && uvicorn app.main:app --port 8000API docs at
http://localhost:8000/docs(Swagger UI). -
Install the SDK
Terminal window npm install openbiometricsTerminal window pip install openbiometrics -
Detect your first face
import { OpenBiometrics } from 'openbiometrics';import { readFileSync } from 'fs';const ob = new OpenBiometrics({apiKey: 'any-value',baseUrl: 'http://localhost:8000',});const photo = readFileSync('photo.jpg');const result = await ob.faces.detect(photo);for (const face of result.faces) {console.log(`Age: ${face.demographics?.age}`);console.log(`Quality: ${face.quality?.overall_score.toFixed(0)}/100`);}from openbiometrics_sdk import OpenBiometricsob = OpenBiometrics(api_key="any-value",base_url="http://localhost:8000",)result = ob.faces.detect("photo.jpg")for face in result["faces"]:print(f"Age: {face['demographics']['age']}")print(f"Quality: {face['quality']['overall_score']:.0f}/100")Terminal window curl -X POST http://localhost:8000/api/v1/detect \-F "image=@photo.jpg" | python -m json.tool -
Verify two faces
const id_photo = readFileSync('id_card.jpg');const selfie = readFileSync('selfie.jpg');const { is_match, similarity } = await ob.faces.verify(id_photo, selfie);console.log(is_match ? 'Identity confirmed' : 'Mismatch');result = ob.faces.verify("id_card.jpg", "selfie.jpg")if result["is_match"]:print(f"Identity confirmed ({result['similarity']:.1%})") -
Build a watchlist
await ob.watchlists.enroll(photo1, { label: 'Alice' });await ob.watchlists.enroll(photo2, { label: 'Bob' });const { matches } = await ob.watchlists.identify(unknownPhoto);for (const match of matches) {console.log(`${match.label}: ${(match.similarity * 100).toFixed(1)}%`);}ob.watchlists.enroll("alice.jpg", label="Alice")ob.watchlists.enroll("bob.jpg", label="Bob")result = ob.watchlists.identify("unknown.jpg")for match in result["matches"]:print(f"{match['label']}: {match['similarity']:.1%}")
What’s Next
Section titled “What’s Next”- Active Liveness — challenge-response anti-spoofing with presets
- Document Processing — MRZ parsing and document scanning
- Video Analytics — real-time camera processing
- Events & Webhooks — subscribe to biometric events
- Docker deployment — containerized setup