Configuration

Configuration Overview

ReID_Database is configured with two parameters:

from degirum_face.reid_database import ReID_DatabasePool

db = ReID_DatabasePool.get(
    db_path="./faces.lance",          # Required: database location
    model_name="arcface_resnet100"    # Optional: model validation
)

Typically initialized via FaceRecognizer/FaceTracker - see FaceRecognizer Configuration or FaceTracker Configuration.


Parameters

db_path (required)

Path to the LanceDB database directory.

Relative path:

db_path="./face_database.lance"

Absolute path:

Windows path:

Database structure:


model_name (optional)

Embedding model name for validation. Ensures database only contains embeddings from compatible models.

Example:

When to use:

  • Multi-model environments

  • Preventing embedding pollution

  • Database migration validation

When to omit:

  • Single-model deployments

  • Testing/development


Initialization Patterns

Connection pooling ensures single connection per database path:

Thread Safety: Database objects returned by the pool are thread-safe. You can safely obtain multiple references to the same database object and use them concurrently from different threads.

Using ReID_Database Directly

Direct instantiation (bypasses connection pooling):

Warning: Not recommended for production. Multiple instances for the same path can cause issues.


Environment-Specific Paths

Development

Production

Docker/Container


See Methods Reference for database operations.

Last updated

Was this helpful?