Releases: cshum/imagorface
v0.3.0
imagorface — Initial Release
imagorface is a new Go module (github.com/cshum/imagorface) that brings pigo-based face detection to imagor as a pluggable Detector implementation.
imagorface implements imagor's Detector interface using the pigo PICO cascade classifier. Detected face bounding boxes replace libvips' attention heuristic as the smart crop anchor, and power the new imagor redaction and detection-visualization filters.
Key capabilities:
- Face-centred smart crop — faces as focal points, no more headless bodies
- Privacy redaction — blur, pixelate, or solid-fill detected faces
- Metadata API — detected regions in
/metaresponses for downstream use - Self-hosted — no third-party API, no per-call cost, embedded cascade
Wire into a custom server binary by adding WithFaceDetector after vipsconfig.WithVips:
config.CreateServer(os.Args[1:],
vipsconfig.WithVips,
imagorface.WithFaceDetector, // must come after WithVips
)Or use the pre-built Docker image:
docker run -p 8000:8000 shumc/imagorface -imagor-unsafe -face-detectorGo Library Usage
imagorface.Detector is also usable directly as a library via imagor.WithDetectors:
app := imagor.New(
imagor.WithProcessors(
vipsprocessor.NewProcessor(
vipsprocessor.WithDetectors(
imagorface.NewDetector(
imagorface.WithMinSize(20),
imagorface.WithMinQuality(5.0),
imagorface.WithCacheSize(1000),
imagorface.WithCacheTTL(10 * time.Minute),
),
),
),
),
)Detection Pipeline
Detection runs on a downscaled greyscale probe (capped by -vips-detector-probe-size, default 400 px) derived from raw decoded pixels — keeping overhead minimal relative to libvips operations. Results are cached by source image path when caching is enabled.