# cvar-vision-dl/remind-reid-tracker architecture

> Architecture diagram of the GitHub repository cvar-vision-dl/remind-reid-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cvar-vision-dl/remind-reid-tracker
- Repository: https://github.com/cvar-vision-dl/remind-reid-tracker

## Overview

#### Purpose and entry points
REMIND is a Python long-term multi-object re-identification tracker for indoor sequences. It assigns persistent IDs using visual descriptors, semantic parts, relational context, and adaptive memory rather than motion tracking. Interactive/local runs enter at `main.py`; the executable pipeline is assembled in `pipeline/reid_pipeline.py`. Evaluation-oriented runners are under `testing/run_tracking_test.py` and batch variants.

#### Input perception and feature construction
Frames are converted into instance detections through interchangeable segmentation backends: YOLO for user data and DAVIS masks for ground-truth evaluation. Perception then computes DINO-based object, part, and background descriptors.
Grounding: `perception/perception_engine.py`, `detection/yolo_segmenter.py`, `detection/davis_segmenter.py`, `features/dino_extractor.py`, `features/object_features.py`, `features/part_features.py`.

#### Frame orchestration
The pipeline follows an ordered per-frame lifecycle: perception, association against current memory, then memory update. Initialization establishes runtime state and existing models; stage modules isolate each lifecycle boundary.
Grounding: `pipeline/reid_pipeline.py`, `pipeline/initialization.py`, `pipeline/perception_stage_full.py`, `pipeline/association_stage.py`, `pipeline/update_stage.py`.

#### Association evidence and candidate formation
Association builds detection-to-track candidates from appearance and relational scores, shapes score paths, and applies policy-based eligibility/confidence decisions. Models and reports provide the shared domain contracts and diagnostic output.
Grounding: `association/engine/data_association.py`, `association/engine/candidate_generation.py`, `association/engine/candidate_shaping/score_path.py`, `association/models.py`, `association/reports.py`.

#### Context, disambiguation, and global resolution
Neighbor-set context represents local scene structure and contributes scoring evidence. Ambiguous visually similar groups undergo anchor selection, component construction, and known-set distance disambiguation before global one-to-one matching. Hungarian assignment is the central resolver; lock resolution handles constrained matches.
Grounding: `association/context/sets_context_builder.py`, `association/scores/sets/sets_scoring.py`, `association/disambiguation/known_set_distance_disambiguator.py`, `association/resolver/hungarian_resolver.py`, `association/resolver/lock_resolver.py`.

#### Assignment outcomes and adaptive memory
Assignment execution applies accepted matches, while post-assignment policies guard outcomes and preserve explicit ambiguous or provisional-new-track states. The update subsystem evolves each tracked object's appearance, part, background, and neighbor models, making later re-identification depend on accumulated evidence.
Grounding: `association/engine/assignment_executor.py`, `association/engine/assignment_result_applier.py`, `memory/memory_store.py`, `memory/tracked_object.py`, `update/memory_manager.py`, `update/descriptors/`.

#### Runtime dependencies and external boundaries
The runtime targets Python 3.10+ with the Conda environment in `environment.yml`. DINOv3 is fetched from HuggingFace on first use; YOLO segmentation weights are local files under `yolo/`. Configuration is YAML-driven, centered on `config/default_config.yaml`, with detector and ablation overrides. Inputs are frame directories or videos; rendered outputs and telemetry are produced by the main/evaluation runners.

Main entry points: [`pipeline/reid_pipeline.py`](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/reid_pipeline.py) (ReID pipeline), [`association/engine/candidate_generation.py`](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/candidate_generation.py) (Candidate generation and shaping), [`perception/perception_engine.py`](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/perception/perception_engine.py) (Perception engine), [`main.py`](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/main.py) (Main and evaluation runners)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_inputs["Frames or video<br/>input"]
  node_entrypoints["Main and evaluation runners<br/>Python runners<br/>[main.py]"]
  node_pipeline["ReID pipeline<br/>pipeline orchestrator<br/>[reid_pipeline.py]"]
  node_initialization["Runtime initialization<br/>pipeline stage<br/>[initialization.py]"]
  node_config["YAML configuration"]
  node_outputs["Rendered output and telemetry"]
end

subgraph group_perception["Perception"]
  node_segmentation["Segmentation backends<br/>detection adapters<br/>[yolo_segmenter.py]"]
  node_perception_engine["Perception engine<br/>per-frame perception"]
  node_dino_features["DINO descriptors<br/>feature extractor<br/>[dino_extractor.py]"]
  node_object_part_features["Object and part features<br/>feature models<br/>[object_features.py]"]
end

subgraph group_association["Association"]
  node_association_stage["Association stage<br/>pipeline stage"]
  node_association_engine["Association engine<br/>candidate association"]
  node_candidates["Candidate generation and shaping<br/>candidate scoring"]
  node_context["Neighbor-set context<br/>relational evidence"]
  node_disambiguation["Known-set disambiguation<br/>ambiguity resolver"]
  node_global_resolution["Global assignment<br/>one-to-one resolver"]
  node_assignment["Assignment application<br/>outcome executor"]
end

subgraph group_memory["Adaptive Memory"]
  node_update_stage["Memory update stage<br/>pipeline stage<br/>[update_stage.py]"]
  node_memory_store[("Tracked-object memory<br/>persistent track store<br/>[memory_store.py]")]
  node_memory_manager["Adaptive model updates<br/>memory evolution<br/>[memory_manager.py]"]
end

node_inputs -->|"provided to"| node_entrypoints
node_entrypoints -->|"runs"| node_pipeline
node_config -.->|"configures"| node_initialization
node_pipeline -->|"initializes"| node_initialization
node_initialization -->|"prepares"| node_perception_engine
node_pipeline -->|"per frame"| node_perception_engine
node_inputs -->|"frames"| node_segmentation
node_segmentation -->|"instance masks"| node_perception_engine
node_perception_engine -->|"instance crops"| node_dino_features
node_dino_features -->|"embeddings"| node_object_part_features
node_object_part_features -->|"detections"| node_association_stage
node_pipeline -->|"after perception"| node_association_stage
node_association_stage -->|"invokes"| node_association_engine
node_memory_store -->|"current tracks"| node_association_engine
node_association_engine -->|"forms"| node_candidates
node_context -->|"relational scores"| node_candidates
node_memory_store -->|"neighbor models"| node_context
node_candidates -->|"ambiguous groups"| node_disambiguation
node_disambiguation -->|"refined candidates"| node_global_resolution
node_candidates -->|"eligible candidates"| node_global_resolution
node_global_resolution -->|"assignments"| node_assignment
node_assignment -->|"outcomes"| node_update_stage
node_pipeline -->|"after association"| node_update_stage
node_update_stage -->|"updates"| node_memory_manager
node_memory_manager -->|"evolves tracks"| node_memory_store
node_entrypoints -->|"renders and reports"| node_outputs

click node_entrypoints "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/main.py"
click node_pipeline "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/reid_pipeline.py"
click node_initialization "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/initialization.py"
click node_config "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/config/default_config.yaml"
click node_segmentation "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/detection/yolo_segmenter.py"
click node_perception_engine "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/perception/perception_engine.py"
click node_dino_features "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/features/dino_extractor.py"
click node_object_part_features "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/features/object_features.py"
click node_association_stage "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/association_stage.py"
click node_association_engine "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/data_association.py"
click node_candidates "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/candidate_generation.py"
click node_context "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/context/sets_context_builder.py"
click node_disambiguation "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/disambiguation/known_set_distance_disambiguator.py"
click node_global_resolution "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/resolver/hungarian_resolver.py"
click node_assignment "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/assignment_executor.py"
click node_update_stage "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/update_stage.py"
click node_memory_store "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/memory/memory_store.py"
click node_memory_manager "https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/update/memory_manager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_inputs,node_entrypoints,node_pipeline,node_initialization,node_config,node_outputs toneBlue
class node_segmentation,node_perception_engine,node_dino_features,node_object_part_features toneAmber
class node_association_stage,node_association_engine,node_candidates,node_context,node_disambiguation,node_global_resolution,node_assignment toneMint
class node_update_stage,node_memory_store,node_memory_manager toneRose
```

## Components

### Runtime

- **Frames or video**: input
- [Main and evaluation runners](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/main.py): Python runners · Interactive runs start at main.py; evaluation uses testing runners. · `main.py`
- [ReID pipeline](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/reid_pipeline.py): pipeline orchestrator · Orders perception, association, and memory update for every frame. · `pipeline/reid_pipeline.py`
- [Runtime initialization](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/initialization.py): pipeline stage · Establishes runtime state and loads existing models. · `pipeline/initialization.py`
- [YAML configuration](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/config/default_config.yaml): configuration · `config/default_config.yaml`
- **Rendered output and telemetry**: output

### Perception

- [Segmentation backends](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/detection/yolo_segmenter.py): detection adapters · YOLO serves user data; DAVIS masks serve ground-truth evaluation. · `detection/yolo_segmenter.py`
- [Perception engine](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/perception/perception_engine.py): per-frame perception · Converts frames and masks into instance detections. · `perception/perception_engine.py`
- [DINO descriptors](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/features/dino_extractor.py): feature extractor · Extracts visual embeddings for objects, parts, and background. · `features/dino_extractor.py`
- [Object and part features](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/features/object_features.py): feature models · `features/object_features.py`

### Association

- [Association stage](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/association_stage.py): pipeline stage · `pipeline/association_stage.py`
- [Association engine](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/data_association.py): candidate association · Builds detection-to-track evidence and policy decisions. · `association/engine/data_association.py`
- [Candidate generation and shaping](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/candidate_generation.py): candidate scoring · Combines appearance and relational score paths into eligible candidates. · `association/engine/candidate_generation.py`
- [Neighbor-set context](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/context/sets_context_builder.py): relational evidence · Represents local scene structure for association scoring. · `association/context/sets_context_builder.py`
- [Known-set disambiguation](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/disambiguation/known_set_distance_disambiguator.py): ambiguity resolver · Separates visually similar groups using anchors and set distance. · `association/disambiguation/known_set_distance_disambiguator.py`
- [Global assignment](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/resolver/hungarian_resolver.py): one-to-one resolver · Hungarian matching resolves assignments; locks handle constraints. · `association/resolver/hungarian_resolver.py`
- [Assignment application](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/association/engine/assignment_executor.py): outcome executor · Applies accepted matches and preserves ambiguous or provisional states. · `association/engine/assignment_executor.py`

### Adaptive Memory

- [Memory update stage](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/pipeline/update_stage.py): pipeline stage · `pipeline/update_stage.py`
- [Tracked-object memory](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/memory/memory_store.py): persistent track store · Stores persistent identities and their accumulated models. · `memory/memory_store.py`
- [Adaptive model updates](https://github.com/cvar-vision-dl/remind-reid-tracker/blob/main/update/memory_manager.py): memory evolution · Updates appearance, part, background, and neighbor evidence. · `update/memory_manager.py`

## Connections

- Frames or video → Main and evaluation runners: provided to
- Main and evaluation runners → ReID pipeline: runs
- YAML configuration → Runtime initialization: configures
- ReID pipeline → Runtime initialization: initializes
- Runtime initialization → Perception engine: prepares
- ReID pipeline → Perception engine: per frame
- Frames or video → Segmentation backends: frames
- Segmentation backends → Perception engine: instance masks
- Perception engine → DINO descriptors: instance crops
- DINO descriptors → Object and part features: embeddings
- Object and part features → Association stage: detections
- ReID pipeline → Association stage: after perception
- Association stage → Association engine: invokes
- Tracked-object memory → Association engine: current tracks
- Association engine → Candidate generation and shaping: forms
- Neighbor-set context → Candidate generation and shaping: relational scores
- Tracked-object memory → Neighbor-set context: neighbor models
- Candidate generation and shaping → Known-set disambiguation: ambiguous groups
- Known-set disambiguation → Global assignment: refined candidates
- Candidate generation and shaping → Global assignment: eligible candidates
- Global assignment → Assignment application: assignments
- Assignment application → Memory update stage: outcomes
- ReID pipeline → Memory update stage: after association
- Memory update stage → Adaptive model updates: updates
- Adaptive model updates → Tracked-object memory: evolves tracks
- Main and evaluation runners → Rendered output and telemetry: renders and reports
