# qvpr/vprtempo architecture

> Architecture diagram of the GitHub repository qvpr/vprtempo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qvpr/vprtempo
- Repository: https://github.com/qvpr/vprtempo

## Overview

VPRTempo is a visual place-recognition application built around temporally encoded spiking neural networks. Its principal workflow is to prepare image datasets, train either the fp32 or quantization-aware model, then evaluate query images against a reference database and report retrieval metrics; the demo visualizes those results. The source index confirms the main model, training, dataset, network-layer, metrics, demo, and download modules, but excerpts are partial. Nordland, Oxford RobotCar, and custom-data preparation are included as documented capabilities; their detailed runtime wiring is not established by the excerpts.

Main entry points: [`main.py`](https://github.com/qvpr/vprtempo/blob/main/main.py) (CLI orchestration), [`vprtempo/VPRTempo.py`](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempo.py) (FP32 inference), [`vprtempo/VPRTempoQuant.py`](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoQuant.py) (Quantized inference), [`vprtempo/src/blitnet.py`](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/blitnet.py) (BLiTNet layers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_cli["CLI orchestration<br/>[main.py]"]
end

subgraph group_models["Network and learning"]
  node_fptrain["FP32 training<br/>[VPRTempoTrain.py]"]
  node_qattrain["QAT training"]
  node_fpmodel["FP32 inference<br/>[VPRTempo.py]"]
  node_qatmodel["Quantized inference<br/>[VPRTempoQuant.py]"]
  node_snn["BLiTNet layers<br/>[blitnet.py]"]
end

subgraph group_data["Data preparation"]
  node_loader["Image dataset loader<br/>[dataset.py]"]
  node_csv["CSV generation<br/>[create_data_csv.py]"]
  node_nordland["Nordland preparation<br/>[nordland.py]"]
  node_robotcar["RobotCar processing<br/>[process_orc.py]"]
  node_downloader["Model and data download<br/>[download.py]"]
  node_store[("Datasets and models")]
end

subgraph group_results["Evaluation and results"]
  node_metrics["Retrieval metrics<br/>[metrics.py]"]
  node_logger["Run logging<br/>[loggers.py]"]
  node_demo["Result visualization<br/>[demo.py]"]
end

node_user(("Researcher"))
node_externaldata(("Dataset providers"))

node_user -->|"runs"| node_cli
node_cli -->|"selects training"| node_fptrain
node_cli -->|"selects training"| node_qattrain
node_cli -.->|"runs evaluation"| node_fpmodel
node_cli -.->|"runs evaluation"| node_qatmodel
node_fptrain -->|"loads training data"| node_loader
node_qattrain -->|"loads training data"| node_loader
node_fptrain -->|"builds layers"| node_snn
node_qattrain -->|"builds layers"| node_snn
node_fpmodel -->|"evaluates batches"| node_loader
node_qatmodel -->|"evaluates batches"| node_loader
node_fpmodel -->|"uses layers"| node_snn
node_qatmodel -->|"uses layers"| node_snn
node_fpmodel -->|"computes metrics"| node_metrics
node_qatmodel -->|"computes metrics"| node_metrics
node_fpmodel -->|"visualizes results"| node_demo
node_cli -->|"initializes logger"| node_logger
node_csv -->|"creates annotations"| node_store
node_nordland -.->|"prepares dataset"| node_store
node_robotcar -.->|"processes images"| node_store
node_externaldata -->|"provides images"| node_nordland
node_externaldata -->|"provides images"| node_robotcar
node_downloader -->|"downloads assets"| node_store

click node_cli "https://github.com/qvpr/vprtempo/blob/main/main.py"
click node_fptrain "https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoTrain.py"
click node_qattrain "https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoQuantTrain.py"
click node_fpmodel "https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempo.py"
click node_qatmodel "https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoQuant.py"
click node_snn "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/blitnet.py"
click node_loader "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/dataset.py"
click node_csv "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/create_data_csv.py"
click node_nordland "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/nordland.py"
click node_robotcar "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/process_orc.py"
click node_downloader "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/download.py"
click node_store "https://github.com/qvpr/vprtempo/tree/main/vprtempo/dataset"
click node_metrics "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/metrics.py"
click node_logger "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/loggers.py"
click node_demo "https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/demo.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_cli toneBlue
class node_fptrain,node_qattrain,node_fpmodel,node_qatmodel,node_snn toneAmber
class node_loader,node_csv,node_nordland,node_robotcar,node_downloader,node_store toneMint
class node_metrics,node_logger,node_demo toneRose
class node_user,node_externaldata toneIndigo
```

## Components

### Application workflow

- [CLI orchestration](https://github.com/qvpr/vprtempo/blob/main/main.py): `main.py`

### Network and learning

- [FP32 training](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoTrain.py): `vprtempo/VPRTempoTrain.py`
- [QAT training](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoQuantTrain.py): `vprtempo/VPRTempoQuantTrain.py`
- [FP32 inference](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempo.py): `vprtempo/VPRTempo.py`
- [Quantized inference](https://github.com/qvpr/vprtempo/blob/main/vprtempo/VPRTempoQuant.py): `vprtempo/VPRTempoQuant.py`
- [BLiTNet layers](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/blitnet.py): `vprtempo/src/blitnet.py`

### Data preparation

- [Image dataset loader](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/dataset.py): `vprtempo/src/dataset.py`
- [CSV generation](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/create_data_csv.py): `vprtempo/src/create_data_csv.py`
- [Nordland preparation](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/nordland.py): `vprtempo/src/nordland.py`
- [RobotCar processing](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/process_orc.py): `vprtempo/src/process_orc.py`
- [Model and data download](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/download.py): `vprtempo/src/download.py`
- [Datasets and models](https://github.com/qvpr/vprtempo/tree/main/vprtempo/dataset): `vprtempo/dataset`

### Evaluation and results

- [Retrieval metrics](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/metrics.py): `vprtempo/src/metrics.py`
- [Run logging](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/loggers.py): `vprtempo/src/loggers.py`
- [Result visualization](https://github.com/qvpr/vprtempo/blob/main/vprtempo/src/demo.py): `vprtempo/src/demo.py`

### Other components

- **Researcher**
- **Dataset providers**

## Connections

- Researcher → CLI orchestration: runs (evidence: `README.md`)
- CLI orchestration → FP32 training: selects training (evidence: `main.py`)
- CLI orchestration → QAT training: selects training (evidence: `main.py`)
- CLI orchestration → FP32 inference: runs evaluation (evidence: `main.py`)
- CLI orchestration → Quantized inference: runs evaluation (evidence: `main.py`)
- FP32 training → Image dataset loader: loads training data (evidence: `vprtempo/VPRTempoTrain.py`)
- QAT training → Image dataset loader: loads training data (evidence: `vprtempo/VPRTempoQuantTrain.py`)
- FP32 training → BLiTNet layers: builds layers (evidence: `vprtempo/VPRTempoTrain.py`)
- QAT training → BLiTNet layers: builds layers (evidence: `vprtempo/VPRTempoQuantTrain.py`)
- FP32 inference → Image dataset loader: evaluates batches (evidence: `vprtempo/VPRTempo.py`)
- Quantized inference → Image dataset loader: evaluates batches (evidence: `vprtempo/VPRTempoQuant.py`)
- FP32 inference → BLiTNet layers: uses layers (evidence: `vprtempo/VPRTempo.py`)
- Quantized inference → BLiTNet layers: uses layers (evidence: `vprtempo/VPRTempoQuant.py`)
- FP32 inference → Retrieval metrics: computes metrics (evidence: `vprtempo/VPRTempo.py`)
- Quantized inference → Retrieval metrics: computes metrics (evidence: `vprtempo/VPRTempoQuant.py`)
- FP32 inference → Result visualization: visualizes results (evidence: `vprtempo/VPRTempo.py`)
- CLI orchestration → Run logging: initializes logger (evidence: `main.py`)
- CSV generation → Datasets and models: creates annotations (evidence: `README.md`)
- Nordland preparation → Datasets and models: prepares dataset
- RobotCar processing → Datasets and models: processes images
- Dataset providers → Nordland preparation: provides images (evidence: `README.md`)
- Dataset providers → RobotCar processing: provides images (evidence: `README.md`)
- Model and data download → Datasets and models: downloads assets (evidence: `vprtempo/src/download.py`)
