# kemo-huang/jmodt architecture

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

- Interactive diagram: https://gitdiagram.com/kemo-huang/jmodt
- Repository: https://github.com/kemo-huang/jmodt

## Overview

#### Purpose and entry points
JMODT is a Python/PyTorch system for joint 3D car detection and multi-object tracking on KITTI tracking data, using camera–LiDAR fusion. Primary workflows are training via `tools/train.py`, tracking evaluation via `tools/eval.py`, and KITTI tracking-to-detection-format conversion via `tools/kitti_converter.py`.

#### Data preparation and dataset boundary
KITTI tracking sequences are converted into a detection-oriented representation while preserving sample/frame and sequence/sample mappings. The detection dataset loader provides calibrated LiDAR, images, labels, and sequence context to model code. Core paths: `jmodt/detection/datasets/kitti_dataset.py`, `tools/kitti_converter.py`, `jmodt/utils/calibration.py`.

#### Detection model pipeline
The detector is a PointRCNN-style two-stage architecture: a PointNet++/fusion backbone produces point features; an RPN predicts foreground regions; proposal processing feeds an RCNN head for final 3D boxes and learned proposal features. Joint training also supports correlation/link and start/end branches; `--finetune` focuses training on those additions from a pretrained detector. Core paths: `jmodt/detection/modeling/point_rcnn.py`, `jmodt/detection/modeling/backbone.py`, `jmodt/detection/modeling/rpn.py`, `jmodt/detection/modeling/rcnn.py`.

#### Proposal and ROI feature boundary
Detection proposals are filtered/formed before RCNN processing, with separate target assignment for training. ROI pooling bridges irregular point-cloud features and fixed-size region features used by classification, regression, and association-related heads. Core paths: `jmodt/detection/layers/proposal_layer.py`, `jmodt/detection/layers/proposal_target_layer.py`, `jmodt/ops/roipool3d/roipool3d_utils.py`.

#### Tracking and temporal association
Per-frame detections/proposal features become tracker observations. The tracker maintains object tracks, predicts state through Kalman filtering, computes inter-frame association, and updates, creates, or retires tracks. Association is the principal detection-to-tracking boundary and incorporates learned/geometry-derived matching inputs. Core paths: `jmodt/tracking/tracker.py`, `jmodt/tracking/data_association.py`, `jmodt/tracking/kalman.py`, `jmodt/tracking/track.py`.

#### Training, inference, and evaluation
Training functions coordinate model losses and optimizer-facing execution; shared geometry/loss transforms support box supervision. Evaluation has separate detection and KITTI tracking evaluation paths, with `tools/eval.py` consuming detector output plus a JMODT checkpoint to measure tracking. Core paths: `jmodt/detection/modeling/train_functions.py`, `jmodt/utils/loss_utils.py`, `jmodt/detection/evaluation/evaluate.py`, `jmodt/tracking/kitti_evaluate.py`.

#### GPU runtime and native operators
The supported runtime is Python 3.8, PyTorch 1.9, and CUDA 11.1 on Ubuntu/Windows. `setup.py develop` builds custom C++/CUDA PyTorch extensions for PointNet++ sampling/grouping/interpolation, 3D ROI pooling, and 3D IoU/NMS-style geometry; these are performance-critical dependencies of detection and proposal processing. Core paths: `setup.py`, `jmodt/ops/pointnet2/src/pointnet2_api.cpp`, `jmodt/ops/roipool3d/src/roipool3d_kernel.cu`, `jmodt/ops/iou3d/src/iou3d_kernel.cu`.

Main entry points: [`jmodt/detection/modeling/point_rcnn.py`](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/point_rcnn.py) (PointRCNN joint model), [`jmodt/tracking/tracker.py`](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/tracker.py) (Multi-object tracker), [`tools/eval.py`](https://github.com/kemo-huang/jmodt/blob/main/tools/eval.py) (Tracking evaluation entry), [`jmodt/detection/modeling/backbone.py`](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/backbone.py) (PointNet++ fusion backbone)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tools["Workflows"]
  node_train["Training entry<br/>Python CLI<br/>[train.py]"]
  node_eval["Tracking evaluation entry<br/>Python CLI<br/>[eval.py]"]
  node_converter["KITTI converter<br/>data conversion CLI<br/>[kitti_converter.py]"]
  node_detection_evaluation["Detection evaluation<br/>detection metrics<br/>[evaluate.py]"]
end

subgraph group_data["Data boundary"]
  node_dataset[("KITTI dataset loader<br/>dataset boundary<br/>[kitti_dataset.py]")]
  node_calibration["Calibration utilities<br/>geometry utility<br/>[calibration.py]"]
end

subgraph group_detector["Detection model"]
  node_point_rcnn["PointRCNN joint model<br/>two-stage detector<br/>[point_rcnn.py]"]
  node_backbone["PointNet++ fusion backbone<br/>point feature encoder<br/>[backbone.py]"]
  node_rpn["RPN<br/>foreground proposal head<br/>[rpn.py]"]
  node_proposal_layer["Proposal filtering<br/>proposal processing<br/>[proposal_layer.py]"]
  node_proposal_targets["Proposal target assignment<br/>training targets"]
  node_roi_pool["3D ROI pooling<br/>fixed-region feature bridge<br/>[roipool3d_utils.py]"]
  node_rcnn["RCNN head<br/>box and feature head<br/>[rcnn.py]"]
  node_train_functions["Training functions<br/>loss execution<br/>[train_functions.py]"]
  node_losses["Loss utilities<br/>supervision geometry<br/>[loss_utils.py]"]
end

subgraph group_tracking["Temporal tracking"]
  node_tracker["Multi-object tracker<br/>track lifecycle<br/>[tracker.py]"]
  node_association["Data association<br/>inter-frame matching"]
  node_kalman["Kalman filter<br/>state prediction<br/>[kalman.py]"]
  node_track["Track state<br/>tracked object<br/>[track.py]"]
  node_kitti_tracking_evaluation["KITTI tracking evaluation<br/>tracking metrics<br/>[kitti_evaluate.py]"]
end

subgraph group_runtime["GPU runtime"]
  node_native_ops{{"CUDA native operators<br/>PyTorch extensions<br/>[setup.py]"}}
  node_pointnet2_api["PointNet++ extension<br/>C++/CUDA operator<br/>[pointnet2_api.cpp]"]
  node_roipool_kernel["3D ROI pool kernel<br/>CUDA operator"]
  node_iou_kernel["3D IoU/NMS kernel<br/>CUDA operator<br/>[iou3d_kernel.cu]"]
end

node_converter -->|"prepares samples"| node_dataset
node_calibration -->|"calibrates inputs"| node_dataset
node_dataset -->|"frame inputs"| node_point_rcnn
node_point_rcnn -->|"encodes points"| node_backbone
node_backbone -->|"point features"| node_rpn
node_rpn -->|"candidate regions"| node_proposal_layer
node_proposal_layer -->|"ROIs"| node_roi_pool
node_backbone -->|"point features"| node_roi_pool
node_roi_pool -->|"ROI features"| node_rcnn
node_proposal_targets -.->|"training targets"| node_rcnn
node_point_rcnn -.->|"training proposals"| node_proposal_targets
node_train -->|"runs training"| node_train_functions
node_train_functions -->|"optimizes"| node_point_rcnn
node_losses -->|"loss primitives"| node_train_functions
node_rcnn -->|"detections and proposal features"| node_tracker
node_tracker -->|"matches observations"| node_association
node_kalman -->|"predicts state"| node_tracker
node_track -->|"maintained tracks"| node_tracker
node_eval -->|"runs checkpoint inference"| node_point_rcnn
node_eval -->|"runs temporal tracking"| node_tracker
node_eval -->|"detection metrics"| node_detection_evaluation
node_eval -->|"tracking metrics"| node_kitti_tracking_evaluation
node_native_ops -->|"builds"| node_pointnet2_api
node_native_ops -->|"builds"| node_roipool_kernel
node_native_ops -->|"builds"| node_iou_kernel
node_pointnet2_api -.->|"sampling/grouping ops"| node_backbone
node_roipool_kernel -.->|"pooling kernel"| node_roi_pool
node_iou_kernel -.->|"IoU/NMS ops"| node_proposal_layer

click node_train "https://github.com/kemo-huang/jmodt/blob/main/tools/train.py"
click node_eval "https://github.com/kemo-huang/jmodt/blob/main/tools/eval.py"
click node_converter "https://github.com/kemo-huang/jmodt/blob/main/tools/kitti_converter.py"
click node_dataset "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/datasets/kitti_dataset.py"
click node_calibration "https://github.com/kemo-huang/jmodt/blob/main/jmodt/utils/calibration.py"
click node_point_rcnn "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/point_rcnn.py"
click node_backbone "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/backbone.py"
click node_rpn "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/rpn.py"
click node_proposal_layer "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/layers/proposal_layer.py"
click node_proposal_targets "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/layers/proposal_target_layer.py"
click node_roi_pool "https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/roipool3d/roipool3d_utils.py"
click node_rcnn "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/rcnn.py"
click node_train_functions "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/train_functions.py"
click node_losses "https://github.com/kemo-huang/jmodt/blob/main/jmodt/utils/loss_utils.py"
click node_tracker "https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/tracker.py"
click node_association "https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/data_association.py"
click node_kalman "https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/kalman.py"
click node_track "https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/track.py"
click node_detection_evaluation "https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/evaluation/evaluate.py"
click node_kitti_tracking_evaluation "https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/kitti_evaluate.py"
click node_native_ops "https://github.com/kemo-huang/jmodt/blob/main/setup.py"
click node_pointnet2_api "https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/pointnet2/src/pointnet2_api.cpp"
click node_roipool_kernel "https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/roipool3d/src/roipool3d_kernel.cu"
click node_iou_kernel "https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/iou3d/src/iou3d_kernel.cu"

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_train,node_eval,node_converter,node_detection_evaluation toneBlue
class node_dataset,node_calibration toneAmber
class node_point_rcnn,node_backbone,node_rpn,node_proposal_layer,node_proposal_targets,node_roi_pool,node_rcnn,node_train_functions,node_losses toneMint
class node_tracker,node_association,node_kalman,node_track,node_kitti_tracking_evaluation toneRose
class node_native_ops,node_pointnet2_api,node_roipool_kernel,node_iou_kernel toneIndigo
```

## Components

### Workflows

- [Training entry](https://github.com/kemo-huang/jmodt/blob/main/tools/train.py): Python CLI · `tools/train.py`
- [Tracking evaluation entry](https://github.com/kemo-huang/jmodt/blob/main/tools/eval.py): Python CLI · `tools/eval.py`
- [KITTI converter](https://github.com/kemo-huang/jmodt/blob/main/tools/kitti_converter.py): data conversion CLI · Converts tracking sequences into detection-oriented samples with sequence mappings. · `tools/kitti_converter.py`
- [Detection evaluation](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/evaluation/evaluate.py): detection metrics · `jmodt/detection/evaluation/evaluate.py`

### Data boundary

- [KITTI dataset loader](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/datasets/kitti_dataset.py): dataset boundary · Supplies calibrated LiDAR, images, labels, and sequence context. · `jmodt/detection/datasets/kitti_dataset.py`
- [Calibration utilities](https://github.com/kemo-huang/jmodt/blob/main/jmodt/utils/calibration.py): geometry utility · `jmodt/utils/calibration.py`

### Detection model

- [PointRCNN joint model](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/point_rcnn.py): two-stage detector · Coordinates detection, proposal features, and joint association branches. · `jmodt/detection/modeling/point_rcnn.py`
- [PointNet++ fusion backbone](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/backbone.py): point feature encoder · `jmodt/detection/modeling/backbone.py`
- [RPN](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/rpn.py): foreground proposal head · `jmodt/detection/modeling/rpn.py`
- [Proposal filtering](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/layers/proposal_layer.py): proposal processing · `jmodt/detection/layers/proposal_layer.py`
- [Proposal target assignment](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/layers/proposal_target_layer.py): training targets · `jmodt/detection/layers/proposal_target_layer.py`
- [3D ROI pooling](https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/roipool3d/roipool3d_utils.py): fixed-region feature bridge · Pools irregular point features into ROI features. · `jmodt/ops/roipool3d/roipool3d_utils.py`
- [RCNN head](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/rcnn.py): box and feature head · Produces final 3D boxes and learned proposal features. · `jmodt/detection/modeling/rcnn.py`
- [Training functions](https://github.com/kemo-huang/jmodt/blob/main/jmodt/detection/modeling/train_functions.py): loss execution · Coordinates model losses, including finetuned joint branches. · `jmodt/detection/modeling/train_functions.py`
- [Loss utilities](https://github.com/kemo-huang/jmodt/blob/main/jmodt/utils/loss_utils.py): supervision geometry · `jmodt/utils/loss_utils.py`

### Temporal tracking

- [Multi-object tracker](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/tracker.py): track lifecycle · Updates, creates, and retires object tracks. · `jmodt/tracking/tracker.py`
- [Data association](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/data_association.py): inter-frame matching · Matches detections using learned and geometry-derived inputs. · `jmodt/tracking/data_association.py`
- [Kalman filter](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/kalman.py): state prediction · `jmodt/tracking/kalman.py`
- [Track state](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/track.py): tracked object · `jmodt/tracking/track.py`
- [KITTI tracking evaluation](https://github.com/kemo-huang/jmodt/blob/main/jmodt/tracking/kitti_evaluate.py): tracking metrics · `jmodt/tracking/kitti_evaluate.py`

### GPU runtime

- [CUDA native operators](https://github.com/kemo-huang/jmodt/blob/main/setup.py): PyTorch extensions · Provides PointNet++, 3D ROI pooling, and IoU/NMS kernels. · `setup.py`
- [PointNet++ extension](https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/pointnet2/src/pointnet2_api.cpp): C++/CUDA operator · `jmodt/ops/pointnet2/src/pointnet2_api.cpp`
- [3D ROI pool kernel](https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/roipool3d/src/roipool3d_kernel.cu): CUDA operator · `jmodt/ops/roipool3d/src/roipool3d_kernel.cu`
- [3D IoU/NMS kernel](https://github.com/kemo-huang/jmodt/blob/main/jmodt/ops/iou3d/src/iou3d_kernel.cu): CUDA operator · `jmodt/ops/iou3d/src/iou3d_kernel.cu`

## Connections

- KITTI converter → KITTI dataset loader: prepares samples
- Calibration utilities → KITTI dataset loader: calibrates inputs
- KITTI dataset loader → PointRCNN joint model: frame inputs
- PointRCNN joint model → PointNet++ fusion backbone: encodes points
- PointNet++ fusion backbone → RPN: point features
- RPN → Proposal filtering: candidate regions
- Proposal filtering → 3D ROI pooling: ROIs
- PointNet++ fusion backbone → 3D ROI pooling: point features
- 3D ROI pooling → RCNN head: ROI features
- Proposal target assignment → RCNN head: training targets
- PointRCNN joint model → Proposal target assignment: training proposals
- Training entry → Training functions: runs training
- Training functions → PointRCNN joint model: optimizes
- Loss utilities → Training functions: loss primitives
- RCNN head → Multi-object tracker: detections and proposal features
- Multi-object tracker → Data association: matches observations
- Kalman filter → Multi-object tracker: predicts state
- Track state → Multi-object tracker: maintained tracks
- Tracking evaluation entry → PointRCNN joint model: runs checkpoint inference
- Tracking evaluation entry → Multi-object tracker: runs temporal tracking
- Tracking evaluation entry → Detection evaluation: detection metrics
- Tracking evaluation entry → KITTI tracking evaluation: tracking metrics
- CUDA native operators → PointNet++ extension: builds
- CUDA native operators → 3D ROI pool kernel: builds
- CUDA native operators → 3D IoU/NMS kernel: builds
- PointNet++ extension → PointNet++ fusion backbone: sampling/grouping ops
- 3D ROI pool kernel → 3D ROI pooling: pooling kernel
- 3D IoU/NMS kernel → Proposal filtering: IoU/NMS ops
