FaceCompressor Class

Namespace: id3.Face

Definition

Compresses portrait images into compact fixed-size templates and decompresses them back into portrait images.

Properties

Name

Type

Description

decoderModel

FaceModel

Model used for face compression decoding.

encoderModel

FaceModel

Model used for face compression encoding.

processingUnit

ProcessingUnit

Processing unit where to run the compression and decompression processes.

threadCount

int

Number of threads to be used for inference.

Methods

Name

Description

compressAi

Detects the largest face in an image, aligns and crops it into a Bioseal portrait (256x192), and compresses it into a fixed-size 500-byte template using a Deep Learning encoder model.

compressAiFromCroppedPortrait

Compresses a pre-aligned 4:3 Bioseal portrait image (256x192) into a fixed-size 500-byte compressed template using a Deep Learning encoder model.

compressAiFromDetectedFace

Aligns and crops an already detected face into a Bioseal portrait (256x192), and compresses it into a fixed-size 500-byte template using a Deep Learning encoder model.

compressWebp

Detects the largest face in an image, crops it using a tighter, eye-distance-based face placement (different from the Bioseal portrait used by compress_ai), resizes the crop to the given output size, and compresses it to WebP so that its size does not exceed the given byte budget.

compressWebpFromCroppedPortrait

Compresses a pre-cropped portrait image to WebP so that its size does not exceed the given byte budget.

compressWebpFromDetectedFace

Crops an already detected face using a tighter, eye-distance-based face placement (different from the Bioseal portrait used by compress_ai_from_detected_face), resizes the crop to the given output size, and compresses it to WebP so that its size does not exceed the given byte budget.

decompressAi

Decompresses a 500-byte compressed template back into a 4:3 portrait image (256x192) using a Deep Learning decoder model.

decompressWebp

Decompresses a WebP buffer produced by compress_webp or compress_webp_from_cropped_portrait back into a portrait image.