How to Enable Re-identification Using Visual Similarity Search#
This guide provides step-by-step instructions to enable or disable re-identification (ReID) using visual similarity search in a Scenescape deployment. By completing this guide, you will:
Enable re-identification using a visual database and feature-matching model.
Understand how to track and evaluate unique object identities across frames.
Learn how to tune performance for specific use cases.
This task is important for enabling persistent object tracking across different camera scenes or time intervals.
Prerequisites for Re-identification#
Before you begin, ensure the following:
Docker is installed and configured.
You have access to modify the
docker-compose.ymlfile in your deployment.You are familiar with scene and camera configuration in Scenescape.
Steps to Enable Reidentification (ReID) for Out of Box Experience#
Select one ReID database
Use one backend override with the base Compose file. Both overrides create the same logical
reidservice and configure the Scene Controller. Run these commands from thesample_data/directory:# VDMS docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller up # Or Qdrant docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.qdrant-override.yml \ --profile controller up
Use exactly one override. Do not combine them. No backend-specific Compose profile or manual service/dependency editing is required.
From the repository root,
make demo-reidstarts the core demo plus the ReID database, defaulting to VDMS. Switch backends withREID_BACKEND:make demo-reid make demo-reid REID_BACKEND=qdrant
Plain
make demoruns tracking without ReID.make demo-closeuses the backend override recorded when the demo was started.Enable Visual Feature Extraction in Video Pipeline Edit the retail-config setting in Docker Compose as follows:
retail-config:
file: ./dlstreamer-pipeline-server/retail-config-reid.json
This reidentification-specific configuration uses a vision pipeline that includes anonymous visual feature extraction (also called “visual embeddings”) using a person reidentification model:
"pipeline": "multifilesrc loop=TRUE location=/home/pipeline-server/videos/apriltag-cam2.ts name=source ! decodebin ! videoconvert ! video/x-raw,format=BGR ! sscape_timestamp_capture name=timesync ntp-server=ntpserv use-frame-ntp-timestamp=false ! gvadetect model=/home/pipeline-server/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml model-proc=/home/pipeline-server/models/object_detection/person/person-detection-retail-0013.json name=detection ! gvainference model=/home/pipeline-server/models/intel/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml inference-region=roi-list ! gvametaconvert add-tensor-data=true name=metaconvert ! sscape_post_inference_data_publish name=datapublisher ! gvametapublish name=destination ! appsink sync=true",
Expected Result: Scenescape starts with ReID enabled and begins assigning UUIDs based on visual similarity.
Selecting the ReID Vector Database Backend#
VDMS and Qdrant are mutually exclusive alternatives. They use the same service
name (reid), hostname (reid.scenescape.intel.com), port (55555), TLS
material, and controller connection settings. The selected override sets
REID_DATABASE and starts the matching database implementation.
Prerequisites#
ReID is already enabled (feature extraction pipeline and
reid-config.jsonas in the steps above).Secrets include shared ReID certificates (
scenescape-reid*/scenescape-reid-s*). Regenerate withmake clean-secrets && make init-secretsif those files are missing.You can pass an override file when starting services.
Steps#
Stop the stack using the same base and backend override files used to start it:
docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller down
Start with the other backend override. For example, to select Qdrant:
docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.qdrant-override.yml \ --profile controller up
The override (docker-compose.qdrant-override.yml):
Starts the logical
reidservice using Qdrant, with TLS on shared hostreid.scenescape.intel.comand port55555Sets
REID_DATABASE=QDRANTon thesceneserviceConnection defaults (hostname, port, TLS=
true, cert paths) are shared viaREID_*settings
Do not combine the backend override files. A deployment has one logical
reidservice and one selected adapter.
Switching back to VDMS#
Stop the Qdrant-backed stack.
Replace the Qdrant override with the VDMS override:
docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller up
Note: Vector data is not migrated between VDMS and Qdrant. After a backend switch, identities are matched only against embeddings stored in the newly selected database.
Kubernetes (Helm)#
The Helm chart mirrors the Compose model: a single logical reid Service backed
by exactly one database Deployment, sharing the reid.scenescape.intel.com
certificates and port 55555. Select the backend with reid.backend:
helm upgrade scenescape-release-1 --install kubernetes/scenescape-chart/ \
-n scenescape --create-namespace \
--set reid.enabled=true --set reid.backend=qdrant
The chart sets REID_DATABASE on the Scene Controller from reid.backend, so
no other value needs to change. Setting reid.enabled=false removes the
database Deployment, Service, and ReID certificates, and drops the ReID client
certificates from the Scene Controller.
From the repository root, make demo-k8s follows the same tiers as the Compose
demo:
make demo-k8s # core services, no ReID
make demo-k8s DEMO_K8S_MODE=reid # core plus ReID (VDMS)
make demo-k8s DEMO_K8S_MODE=reid REID_BACKEND=qdrant # core plus ReID (Qdrant)
make demo-k8s DEMO_K8S_MODE=all # ReID plus mapping and cluster analytics
Expected Result: The Scene Controller connects to Qdrant, creates or verifies the ReID collection, and continues UUID assignment via visual similarity.
Service-link environment variables#
The ReID Service is named reid, so Kubernetes injects REID_PORT=tcp://<clusterIP>:<port>
into every pod in the namespace, which collides with the REID_PORT setting
described above. The chart sets enableServiceLinks: false on the Scene
Controller to suppress this; all of its dependencies are addressed by DNS.
If you write your own manifests, either do the same or set REID_PORT
explicitly, since values in env take precedence over service links. As a
backstop, the controller ignores any REID_* value that looks like a service
link (tcp://…) and logs a warning rather than failing to start.
ReID pod filesystem#
The ReID container runs with readOnlyRootFilesystem: true. Each backend gets
emptyDir volumes for the only paths it writes:
Backend |
Writable mounts |
Notes |
|---|---|---|
VDMS |
|
|
Qdrant |
|
|
Because the VDMS image writes its generated config next to the server binary,
the chart renders that config into /vdms/data and starts the server with
-cfg. If you pin a different VDMS image, confirm it still provides
override_default_config.py and the -cfg flag.
ReID vector data is stored in emptyDir and is lost when the pod restarts,
which matches the behaviour before the volumes existed. Replace reid-data
with a PersistentVolumeClaim if the embeddings must survive restarts.
The pod still runs as root (runAsUser: 0) because both upstream images expect
it; that is a separate hardening step.
Steps to Disable Re-identification#
Stop using the backend override
Stop the stack with its active override, then restart the base Compose file without either ReID backend override. The base file does not contain a ReID database service.
docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller down
Substitute
docker-compose.qdrant-override.ymlwhen Qdrant is active.Remove ReID from the Camera Pipeline Edit the retail-config setting in Docker Compose and revert to the config without re-id model:
retail-config:
file: ./dlstreamer-pipeline-server/retail-config.json
Restart the System:
docker compose --profile controller up --build
Expected Result: Scenescape runs without ReID and no visual feature matching is performed.
Evaluating Re-identification Performance#
Track Unique IDs:
Scenescape publishesunique_detection_countvia MQTT under the scene category topic. Each object includes anidfield (UUID) for tracking.UI Support:
UUID display in the 3D UI is planned for future releases.
Note: The default ReID model is tuned for the ‘person’ category and may not generalize well to other object types.
How Re-identification Works#
When an object is first detected, it is assigned a UUID and no similarity score. If ReID is enabled, the system collects visual features over time. Once enough features are gathered, they are compared to those in the database:
Match Found: The object is reassigned a matching UUID and given a similarity score.
No Match: The object retains its original UUID.
The scene output includes reid_state for each tracked object. For canonical state definitions and lifecycle transitions, see 2-Tier Hybrid Search Implementation. For output field contract details, see Scene Controller Data Formats.
Known Issue: Current VDMS implementation does not support feature expiration, leading to degraded performance over time. This will be addressed in a future release.
Configuration Options#
Parameter |
Purpose |
Expected Value/Range |
|---|---|---|
|
Match-acceptance threshold defaults selected by |
Float; tune per metric. For |
|
Minimum bounding box size to consider a valid feature. |
Pixel area (e.g., 400–1600) |
|
Minimum features needed before querying DB. |
Integer (e.g., 5–20) |
|
Proportion of features stored to improve DB performance. |
Float (e.g., 0.1–1.0) |
To apply changes, use the same backend override you selected when starting the stack:
docker compose -f docker-compose-dl-streamer-example.yml \
-f docker-compose.vdms-override.yml \
--profile controller down
make -C docker
docker compose -f docker-compose-dl-streamer-example.yml \
-f docker-compose.vdms-override.yml \
--profile controller up --build
Troubleshooting#
Issue: ReID not working
Cause: Database container is not running, not linked, or TLS/certs do not match the shared ReID defaults.
Resolution:
docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller ps reid docker compose -f docker-compose-dl-streamer-example.yml \ -f docker-compose.vdms-override.yml \ --profile controller logs reid
Substitute the Qdrant override when it is selected. Confirm the
reidservice is healthy, the expectedREID_DATABASEis set onscene, and the sharedscenescape-reid*certificates exist.
Issue: Objects not re-identifying across scenes
Cause: Insufficient visual features collected or poor lighting.
Resolution:
Lower
DEFAULT_MINIMUM_FEATURE_COUNT.Increase
DEFAULT_MINIMUM_BBOX_AREAonly if objects are large and visible.
Issue: Backend switch appears to “lose” identities
Cause: VDMS and Qdrant do not share stored embeddings.
Resolution: Expected after switching
REID_DATABASE. Re-accumulate features in the new backend, or restore the previous backend and its data volume.