# zhangaocanada/raddet architecture

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

- Interactive diagram: https://gitdiagram.com/zhangaocanada/raddet
- Repository: https://github.com/zhangaocanada/raddet

## Overview

RADDet is a TensorFlow radar object-detection research project. Its principal workflow prepares RAD tensors and labels, trains or loads a detector with a 3D RAD head and a Cartesian-box head, then runs inference or evaluation to produce detections, metrics, and visualizations. The README documents both detection spaces and the RadarResNet/VGG backbone options. Some connections below rely on the SOURCE INDEX or README rather than full source excerpts; unsampled implementation details are not inferred.

Main entry points: [`model/model.py`](https://github.com/zhangaocanada/raddet/blob/main/model/model.py) (RAD detector), [`inference.py`](https://github.com/zhangaocanada/raddet/blob/main/inference.py) (Run inference), [`dataset/batch_data_generator.py`](https://github.com/zhangaocanada/raddet/blob/main/dataset/batch_data_generator.py) (Batch data generator), [`evaluate.py`](https://github.com/zhangaocanada/raddet/blob/main/evaluate.py) (Evaluate detections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Entry workflows"]
  node_training["Train RAD model<br/>[train.py]"]
  node_cart_training["Train Cartesian head<br/>[train_cart.py]"]
  node_inference["Run inference<br/>[inference.py]"]
  node_evaluation["Evaluate detections<br/>[evaluate.py]"]
end

subgraph group_data["Data handling"]
  node_generator["Batch data generator"]
  node_loader["Dataset and config loader<br/>[loader.py]"]
  node_helper["Geometry and transforms<br/>[helper.py]"]
end

subgraph group_detection["Detection models"]
  node_rad_model["RAD detector<br/>[model.py]"]
  node_cart_model["Cartesian detector<br/>[model_cart.py]"]
  node_resnet["RadarResNet backbone"]
  node_vgg["VGG backbone option<br/>[backbone_VGG.py]"]
  node_yolo["YOLO detection head<br/>[head_YOLO.py]"]
  node_layers["Neural network layers<br/>[layers.py]"]
  node_loss["Detection losses<br/>[loss_functions.py]"]
end

subgraph group_support["Metrics and presentation"]
  node_metrics["mAP metrics<br/>[mAP.py]"]
  node_drawer["Detection visualizations<br/>[drawer.py]"]
end

node_researcher(("Researcher"))
node_radar_data[("Radar data")]
node_results["Metrics and plots"]

node_researcher -->|"trains"| node_training
node_researcher -->|"runs"| node_inference
node_radar_data -->|"provides frames"| node_generator
node_training -->|"loads configuration"| node_loader
node_training -->|"trains"| node_rad_model
node_training -->|"requests batches"| node_generator
node_cart_training -->|"builds backbone"| node_rad_model
node_cart_training -->|"trains"| node_cart_model
node_cart_training -->|"requests batches"| node_generator
node_inference -->|"loads configuration"| node_loader
node_inference -->|"runs detector"| node_rad_model
node_inference -->|"runs detector"| node_cart_model
node_inference -->|"loads data"| node_generator
node_inference -->|"plots detections"| node_drawer
node_evaluation -->|"requests batches"| node_generator
node_evaluation -->|"runs detector"| node_rad_model
node_evaluation -->|"runs detector"| node_cart_model
node_evaluation -->|"computes AP"| node_metrics
node_evaluation -->|"plots results"| node_drawer
node_generator -->|"reads samples"| node_loader
node_generator -->|"encodes labels"| node_helper
node_rad_model -->|"builds backbone"| node_resnet
node_rad_model -.->|"offers backbone"| node_vgg
node_rad_model -->|"builds head"| node_yolo
node_rad_model -->|"computes loss"| node_loss
node_resnet -->|"uses layers"| node_layers
node_vgg -->|"uses layers"| node_layers
node_yolo -->|"uses layers"| node_layers
node_cart_model -->|"uses layers"| node_layers
node_cart_model -->|"uses geometry"| node_helper
node_metrics -->|"computes IoU"| node_helper
node_inference -->|"produces"| node_results
node_evaluation -->|"produces"| node_results

click node_training "https://github.com/zhangaocanada/raddet/blob/main/train.py"
click node_cart_training "https://github.com/zhangaocanada/raddet/blob/main/train_cart.py"
click node_inference "https://github.com/zhangaocanada/raddet/blob/main/inference.py"
click node_evaluation "https://github.com/zhangaocanada/raddet/blob/main/evaluate.py"
click node_generator "https://github.com/zhangaocanada/raddet/blob/main/dataset/batch_data_generator.py"
click node_loader "https://github.com/zhangaocanada/raddet/blob/main/util/loader.py"
click node_helper "https://github.com/zhangaocanada/raddet/blob/main/util/helper.py"
click node_rad_model "https://github.com/zhangaocanada/raddet/blob/main/model/model.py"
click node_cart_model "https://github.com/zhangaocanada/raddet/blob/main/model/model_cart.py"
click node_resnet "https://github.com/zhangaocanada/raddet/blob/main/model/backbone_radarResNet.py"
click node_vgg "https://github.com/zhangaocanada/raddet/blob/main/model/backbone_VGG.py"
click node_yolo "https://github.com/zhangaocanada/raddet/blob/main/model/head_YOLO.py"
click node_layers "https://github.com/zhangaocanada/raddet/blob/main/model/layers.py"
click node_loss "https://github.com/zhangaocanada/raddet/blob/main/model/loss_functions.py"
click node_metrics "https://github.com/zhangaocanada/raddet/blob/main/metrics/mAP.py"
click node_drawer "https://github.com/zhangaocanada/raddet/blob/main/util/drawer.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_training,node_cart_training,node_inference,node_evaluation toneBlue
class node_generator,node_loader,node_helper,node_radar_data toneAmber
class node_rad_model,node_cart_model,node_resnet,node_vgg,node_yolo,node_layers,node_loss toneMint
class node_metrics,node_drawer toneRose
class node_researcher,node_results toneIndigo
```

## Components

### Entry workflows

- [Train RAD model](https://github.com/zhangaocanada/raddet/blob/main/train.py): `train.py`
- [Train Cartesian head](https://github.com/zhangaocanada/raddet/blob/main/train_cart.py): `train_cart.py`
- [Run inference](https://github.com/zhangaocanada/raddet/blob/main/inference.py): `inference.py`
- [Evaluate detections](https://github.com/zhangaocanada/raddet/blob/main/evaluate.py): `evaluate.py`

### Data handling

- [Batch data generator](https://github.com/zhangaocanada/raddet/blob/main/dataset/batch_data_generator.py): `dataset/batch_data_generator.py`
- [Dataset and config loader](https://github.com/zhangaocanada/raddet/blob/main/util/loader.py): `util/loader.py`
- [Geometry and transforms](https://github.com/zhangaocanada/raddet/blob/main/util/helper.py): `util/helper.py`

### Detection models

- [RAD detector](https://github.com/zhangaocanada/raddet/blob/main/model/model.py): `model/model.py`
- [Cartesian detector](https://github.com/zhangaocanada/raddet/blob/main/model/model_cart.py): `model/model_cart.py`
- [RadarResNet backbone](https://github.com/zhangaocanada/raddet/blob/main/model/backbone_radarResNet.py): `model/backbone_radarResNet.py`
- [VGG backbone option](https://github.com/zhangaocanada/raddet/blob/main/model/backbone_VGG.py): `model/backbone_VGG.py`
- [YOLO detection head](https://github.com/zhangaocanada/raddet/blob/main/model/head_YOLO.py): `model/head_YOLO.py`
- [Neural network layers](https://github.com/zhangaocanada/raddet/blob/main/model/layers.py): `model/layers.py`
- [Detection losses](https://github.com/zhangaocanada/raddet/blob/main/model/loss_functions.py): `model/loss_functions.py`

### Metrics and presentation

- [mAP metrics](https://github.com/zhangaocanada/raddet/blob/main/metrics/mAP.py): `metrics/mAP.py`
- [Detection visualizations](https://github.com/zhangaocanada/raddet/blob/main/util/drawer.py): `util/drawer.py`

### Other components

- **Researcher**
- **Radar data**
- **Metrics and plots**

## Connections

- Researcher → Train RAD model: trains (evidence: `README.md`)
- Researcher → Run inference: runs (evidence: `README.md`)
- Radar data → Batch data generator: provides frames (evidence: `dataset/batch_data_generator.py`)
- Train RAD model → Dataset and config loader: loads configuration (evidence: `train.py`)
- Train RAD model → RAD detector: trains (evidence: `train.py`)
- Train RAD model → Batch data generator: requests batches (evidence: `train.py`)
- Train Cartesian head → RAD detector: builds backbone (evidence: `train_cart.py`)
- Train Cartesian head → Cartesian detector: trains (evidence: `train_cart.py`)
- Train Cartesian head → Batch data generator: requests batches (evidence: `train_cart.py`)
- Run inference → Dataset and config loader: loads configuration (evidence: `inference.py`)
- Run inference → RAD detector: runs detector (evidence: `inference.py`)
- Run inference → Cartesian detector: runs detector (evidence: `inference.py`)
- Run inference → Batch data generator: loads data (evidence: `inference.py`)
- Run inference → Detection visualizations: plots detections (evidence: `inference.py`)
- Evaluate detections → Batch data generator: requests batches (evidence: `evaluate.py`)
- Evaluate detections → RAD detector: runs detector (evidence: `evaluate.py`)
- Evaluate detections → Cartesian detector: runs detector (evidence: `evaluate.py`)
- Evaluate detections → mAP metrics: computes AP (evidence: `evaluate.py`)
- Evaluate detections → Detection visualizations: plots results (evidence: `evaluate.py`)
- Batch data generator → Dataset and config loader: reads samples (evidence: `dataset/batch_data_generator.py`)
- Batch data generator → Geometry and transforms: encodes labels (evidence: `dataset/batch_data_generator.py`)
- RAD detector → RadarResNet backbone: builds backbone (evidence: `model/model.py`)
- RAD detector → VGG backbone option: offers backbone (evidence: `model/model.py`)
- RAD detector → YOLO detection head: builds head (evidence: `model/model.py`)
- RAD detector → Detection losses: computes loss (evidence: `model/model.py`)
- RadarResNet backbone → Neural network layers: uses layers (evidence: `model/backbone_radarResNet.py`)
- VGG backbone option → Neural network layers: uses layers (evidence: `model/backbone_VGG.py`)
- YOLO detection head → Neural network layers: uses layers (evidence: `model/head_YOLO.py`)
- Cartesian detector → Neural network layers: uses layers (evidence: `model/model_cart.py`)
- Cartesian detector → Geometry and transforms: uses geometry (evidence: `model/model_cart.py`)
- mAP metrics → Geometry and transforms: computes IoU (evidence: `metrics/mAP.py`)
- Run inference → Metrics and plots: produces (evidence: `inference.py`)
- Evaluate detections → Metrics and plots: produces (evidence: `evaluate.py`)
