Fast lightweight plug-and-play face recognition optimization engine
Project description
FLIQ
FLIQ is a lightweight face recognition acceleration layer for Python that combines detection, embedding, tracking, caching, vector search, and streaming helpers in a single package. It is designed to run with only NumPy installed, while optional extras unlock FastAPI, OpenCV, FAISS, and ONNX-backed acceleration paths.
What It Does
FLIQ provides a practical face recognition engine for image, video, and streaming workloads. The package centers on the Fliq engine and exposes:
- face registration and recognition for still images
- video and iterable-based stream processing
- tracking-aware recognition with classroom/session-style caches
- motion detection and adaptive frame scheduling support
- FAISS-backed similarity search with a NumPy fallback path
- optional FastAPI routes for service integration
- benchmark helpers for measuring throughput, latency, memory, and stream behavior
The package exports Fliq, FliqConfig, and RecognitionMatch from the top-level fliqx module.
Installation
FLIQ requires Python 3.10 or newer.
Install the core package from source:
pip install .
Install with optional extras depending on your use case:
pip install .[full]
Available extras:
apifor FastAPI and Uvicornvideofor OpenCV-based video supportonnxfor ONNX Runtime-based detector and embedder adaptersfaissfor FAISS vector search supportdevfor local testingfullfor API, video, and test dependencies together
For local development from the repository:
pip install -e .[dev]
Quick Start
import numpy as np
from fliqx import Fliq
engine = Fliq()
image = np.zeros((256, 256, 3), dtype=np.uint8)
engine.register("person-001", image)
results = engine.recognize(image)
print(results)
If you want to process video or frame iterables:
frames = [np.zeros((256, 256, 3), dtype=np.uint8) for _ in range(5)]
for frame_result in engine.track_video(frames):
print(frame_result)
Public API
The main engine methods are:
register(user_id, image)to add a known facerecognize(image, class_id=None)to run recognition on a still framerecognize_video(video)to process a video source or iterable of framestrack_video(source, include_tracking=True, class_id=None)for streaming recognition with trackingsave_index(directory=None)andload_index(directory=None)for persistenceremove_user(user_id)to delete a subject from the indexsnapshot_metrics()for runtime counters and uptimeoptimize_existing(embeddings, ids)for bulk index updates
The configuration object FliqConfig controls runtime behavior such as:
- device selection
- frame skipping and recognition cadence
- detector, embedder, tracker, and vector backend selection
- confidence thresholds
- cache sizes and concurrency limits
- warmup behavior and motion sensitivity
Architecture
FLIQ is organized around a few cooperating layers:
fliq.detectionprovides detector abstractions and adapters, including auto, whole-frame, RetinaFace, and SCRFD-based pathsfliq.embeddingsprovides embedder abstractions, including lightweight, ArcFace, and Buffalo-style optionsfliq.trackingprovides tracking implementations, including ByteTrack-inspired variantsfliq.vectorprovides similarity search, persistence, and optional FAISS accelerationfliq.cacheprovides embedding, match, memory, and session cachesfliq.videoprovides frame handling, motion detection, and scheduling helpersfliq.apiexposes a FastAPI application and JSON routesfliq.benchmarksprovides benchmark routines and result reporting
When optional acceleration packages are unavailable, the engine falls back to pure Python and NumPy implementations so the package remains usable in minimal environments.
Configuration Examples
from fliqx import Fliq
engine = Fliq(
mode="balanced",
detector="scrfd",
embedder="buffalo",
tracker="bytetrack",
vector_backend="faiss",
warmup=True,
)
Common runtime modes:
speedfor higher throughputbalancedfor a middle ground between latency and qualityaccuracyfor tighter recognition cadence and thresholding
API Service
If you install the api extra, you can create a FastAPI app around the engine:
from fliqx.api.fastapi_app import create_app
app = create_app()
Available routes:
GET /for a readiness responseGET /healthfor a health checkPOST /registerfor user registrationPOST /recognizefor recognition requests
Benchmarks
The repository includes benchmark helpers for both single-frame recognition and concurrent classroom-style loads.
Run the benchmark script from the repository root:
python scripts/benchmark_runner.py
The benchmark output reports:
- total time and per-call latency
- frames per second
- recognition call and result counts
- concurrent stream usage
- queue peak size
- CPU and GPU utilization when available
- RSS memory deltas
- stream recovery counts
Development
Run the test suite with:
pytest
The repository is configured for editable installs and includes package markers so the full fliqx tree is discoverable during development and wheel builds.
PyPI Distribution
What's Included in PyPI Package:
- Core FLIQ engine (
fliq/) - All detection, embedding, tracking, vector, video, and cache modules
- CLI tools (
fliq/cli.py) - Production hardening modules (stress, stability, protection)
- Type hints and markers
What's Excluded from PyPI (GitHub only):
- Test files (
fliq/tests/) - Development documentation:
PRODUCTION.md- Production deployment guideUPGRADE_SUMMARY.md- Change summaryCLI_REFERENCE.md- CLI usage referenceIMPLEMENTATION_COMPLETE.md- Implementation detailsREADME_PRODUCTION.md- File reference
- Benchmark reports directory (
benchmarks/reports/) - Scripts directory (
scripts/) - Build and configuration files (
setup.py,.github/, etc.)
Why? The PyPI package is kept lean (only production code) while the GitHub repository includes comprehensive testing, documentation, and development tools. This keeps package size small and installation fast while maintaining full transparency and documentation in the source repository.
To Install from PyPI:
pip install fliq
To Get Development Version with All Tests and Docs:
git clone https://github.com/your-org/fliq.git
cd fliq
pip install -e .[dev]
Project Layout
fliq/engine.pycontains the main orchestration enginefliq/config.pycontains runtime configuration defaults and validationfliq/api/contains the HTTP service layerfliq/cache/contains in-memory caches and session statefliq/detection/contains detector implementations and adaptersfliq/embeddings/contains embedding models and wrappersfliq/tracking/contains tracking logicfliq/vector/contains vector search and persistence helpersfliq/video/contains frame, motion, and stream utilitiesfliq/benchmarks/contains benchmark helpers and metricsfliq/stress/contains stress testing framework (production hardening)fliq/stability/contains stability monitoring (production hardening)fliq/protection.pycontains load protection systems (production hardening)scripts/benchmark_runner.pyis a runnable benchmark entry point
Notes
FLIQ is intentionally modular: you can use the core NumPy-only package for development and testing, then add optional extras only when your deployment needs them. Saved indexes are automatically loaded when an index directory is present, and recognition results are cached to reduce repeated work in high-throughput workloads.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fliqx-0.1.2.tar.gz.
File metadata
- Download URL: fliqx-0.1.2.tar.gz
- Upload date:
- Size: 48.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f73672d8f563e4d058b06ec157e3c1cbbf826ea00e9feabcff97f6219d75020e
|
|
| MD5 |
6e6666242a610cf3f163cb939af62b19
|
|
| BLAKE2b-256 |
70e8aeb5748047849fe9040aea6ab5663d3e2bce56e0ea3c51c971eddbaaf80d
|
Provenance
The following attestation bundles were made for fliqx-0.1.2.tar.gz:
Publisher:
publish-to-pypi.yml on mani1028/fliqx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fliqx-0.1.2.tar.gz -
Subject digest:
f73672d8f563e4d058b06ec157e3c1cbbf826ea00e9feabcff97f6219d75020e - Sigstore transparency entry: 1503263648
- Sigstore integration time:
-
Permalink:
mani1028/fliqx@43cad602bc636d0bbad58c2dfae7e519274c9a84 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mani1028
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@43cad602bc636d0bbad58c2dfae7e519274c9a84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fliqx-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fliqx-0.1.2-py3-none-any.whl
- Upload date:
- Size: 61.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f47509f294d84bf608061581baf00cb0376f811e2c2b311eacc0c15ed5a2b94
|
|
| MD5 |
852208084cce8e059c4cf1038b84b82b
|
|
| BLAKE2b-256 |
3f508bd70e0172f5899614f481e6e05e120d06ff26bbadfaf8c3747db5f3a194
|
Provenance
The following attestation bundles were made for fliqx-0.1.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on mani1028/fliqx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fliqx-0.1.2-py3-none-any.whl -
Subject digest:
5f47509f294d84bf608061581baf00cb0376f811e2c2b311eacc0c15ed5a2b94 - Sigstore transparency entry: 1503263791
- Sigstore integration time:
-
Permalink:
mani1028/fliqx@43cad602bc636d0bbad58c2dfae7e519274c9a84 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mani1028
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@43cad602bc636d0bbad58c2dfae7e519274c9a84 -
Trigger Event:
push
-
Statement type: