# intellindust-ai-lab/gtr architecture

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

- Interactive diagram: https://gitdiagram.com/intellindust-ai-lab/gtr
- Repository: https://github.com/intellindust-ai-lab/gtr

## Overview

GTR is a PyTorch vision system for dense prediction: its recurrent vision backbone feeds task-specific models for detection, instance and semantic segmentation, pose, depth, and oriented-box detection. The principal workflow configures a task, loads and transforms datasets, runs training or evaluation through solver engines, and produces predictions or metrics. The README also documents ONNX/TensorRT deployment. Several subsystem paths and capabilities come from the tree and README; unsampled wiring is shown only where documented, not inferred as direct calls.

Main entry points: [`engine/gtr/hybrid_encoder.py`](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/hybrid_encoder.py) (Feature encoder), [`train.py`](https://github.com/intellindust-ai-lab/gtr/blob/main/train.py) (Training entry), [`engine/gtr/backbone/vit_adapter.py`](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/backbone/vit_adapter.py) (GTR backbone), [`engine/solver/depth_solver.py`](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/depth_solver.py) (Depth solver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_datasets["Task datasets"]
  node_transforms["Transforms and batching"]
end

subgraph group_model["GTR models"]
  node_backbone["GTR backbone<br/>[vit_adapter.py]"]
  node_encoder["Feature encoder<br/>[hybrid_encoder.py]"]
  node_det["Detection model<br/>[decoder.py]"]
  node_instance["Instance segmentation"]
  node_obb["Oriented detection<br/>[decoder.py]"]
  node_pose["Pose model<br/>[decoder.py]"]
  node_semseg["Semantic segmentation<br/>[gtrsemseg.py]"]
  node_depth["Depth model<br/>[gtrdepth.py]"]
end

subgraph group_runtime["Training and evaluation"]
  node_config["Config and workspace<br/>[workspace.py]"]
  node_train["Training entry<br/>[train.py]"]
  node_det_solver["Detection solver<br/>[det_solver.py]"]
  node_depth_solver["Depth solver<br/>[depth_solver.py]"]
  node_semseg_solver["Segmentation solver<br/>[semseg_solver.py]"]
  node_depth_eval["Depth evaluation<br/>[depth_engine.py]"]
  node_inference["PyTorch inference<br/>[torch_inf.py]"]
end

subgraph group_deploy["Deployment"]
  node_export["ONNX export<br/>[export_onnx.py]"]
  node_patches["ONNX model patches"]
  node_trt["TensorRT verification<br/>[verify_trt.py]"]
end

node_user(("Researcher"))
node_predictions["Predictions and metrics"]

node_user -->|"configures"| node_config
node_config -->|"configures"| node_train
node_datasets -->|"loads and transforms"| node_transforms
node_train -->|"uses"| node_datasets
node_train -->|"starts training"| node_det_solver
node_train -->|"starts training"| node_depth_solver
node_train -->|"starts training"| node_semseg_solver
node_det_solver -->|"runs model"| node_backbone
node_depth_solver -->|"runs model"| node_backbone
node_semseg_solver -->|"runs model"| node_backbone
node_backbone -->|"features"| node_encoder
node_encoder -->|"features"| node_det
node_encoder -->|"features"| node_instance
node_encoder -->|"features"| node_obb
node_encoder -->|"features"| node_pose
node_encoder -->|"features"| node_semseg
node_encoder -->|"features"| node_depth
node_depth_solver -->|"evaluates"| node_depth_eval
node_depth_eval -->|"returns metrics"| node_predictions
node_user -->|"requests inference"| node_inference
node_inference -->|"produces"| node_predictions
node_user -.->|"requests export"| node_export
node_export -.->|"applies patches"| node_patches
node_export -.->|"exports model for"| node_trt
node_trt -.->|"verifies outputs"| node_predictions

click node_config "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/core/workspace.py"
click node_datasets "https://github.com/intellindust-ai-lab/gtr/tree/main/engine/data/dataset"
click node_transforms "https://github.com/intellindust-ai-lab/gtr/tree/main/engine/data/transforms"
click node_backbone "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/backbone/vit_adapter.py"
click node_encoder "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/hybrid_encoder.py"
click node_det "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/det/decoder.py"
click node_instance "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/det/segmentation_head.py"
click node_obb "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/obb/decoder.py"
click node_pose "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/pose/decoder.py"
click node_semseg "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/semseg/gtrsemseg.py"
click node_depth "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/depth/gtrdepth.py"
click node_train "https://github.com/intellindust-ai-lab/gtr/blob/main/train.py"
click node_det_solver "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/det_solver.py"
click node_depth_solver "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/depth_solver.py"
click node_semseg_solver "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/semseg_solver.py"
click node_depth_eval "https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/depth_engine.py"
click node_inference "https://github.com/intellindust-ai-lab/gtr/blob/main/tools/inference/torch_inf.py"
click node_export "https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/export_onnx.py"
click node_patches "https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/gtr_onnx_patches.py"
click node_trt "https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/verify_trt.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_datasets,node_transforms toneBlue
class node_backbone,node_encoder,node_det,node_instance,node_obb,node_pose,node_semseg,node_depth toneAmber
class node_config,node_train,node_det_solver,node_depth_solver,node_semseg_solver,node_depth_eval,node_inference toneMint
class node_export,node_patches,node_trt toneRose
class node_user,node_predictions toneIndigo
```

## Components

### Data preparation

- [Task datasets](https://github.com/intellindust-ai-lab/gtr/tree/main/engine/data/dataset): `engine/data/dataset`
- [Transforms and batching](https://github.com/intellindust-ai-lab/gtr/tree/main/engine/data/transforms): `engine/data/transforms`

### GTR models

- [GTR backbone](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/backbone/vit_adapter.py): `engine/gtr/backbone/vit_adapter.py`
- [Feature encoder](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/hybrid_encoder.py): `engine/gtr/hybrid_encoder.py`
- [Detection model](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/det/decoder.py): `engine/gtr/det/decoder.py`
- [Instance segmentation](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/det/segmentation_head.py): `engine/gtr/det/segmentation_head.py`
- [Oriented detection](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/obb/decoder.py): `engine/gtr/obb/decoder.py`
- [Pose model](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/pose/decoder.py): `engine/gtr/pose/decoder.py`
- [Semantic segmentation](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/semseg/gtrsemseg.py): `engine/gtr/semseg/gtrsemseg.py`
- [Depth model](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/gtr/depth/gtrdepth.py): `engine/gtr/depth/gtrdepth.py`

### Training and evaluation

- [Config and workspace](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/core/workspace.py): `engine/core/workspace.py`
- [Training entry](https://github.com/intellindust-ai-lab/gtr/blob/main/train.py): `train.py`
- [Detection solver](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/det_solver.py): `engine/solver/det_solver.py`
- [Depth solver](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/depth_solver.py): `engine/solver/depth_solver.py`
- [Segmentation solver](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/semseg_solver.py): `engine/solver/semseg_solver.py`
- [Depth evaluation](https://github.com/intellindust-ai-lab/gtr/blob/main/engine/solver/depth_engine.py): `engine/solver/depth_engine.py`
- [PyTorch inference](https://github.com/intellindust-ai-lab/gtr/blob/main/tools/inference/torch_inf.py): `tools/inference/torch_inf.py`

### Deployment

- [ONNX export](https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/export_onnx.py): `tensorrt_plugin/export_onnx.py`
- [ONNX model patches](https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/gtr_onnx_patches.py): `tensorrt_plugin/gtr_onnx_patches.py`
- [TensorRT verification](https://github.com/intellindust-ai-lab/gtr/blob/main/tensorrt_plugin/verify_trt.py): `tensorrt_plugin/verify_trt.py`

### Other components

- **Researcher**
- **Predictions and metrics**

## Connections

- Researcher → Config and workspace: configures
- Config and workspace → Training entry: configures
- Task datasets → Transforms and batching: loads and transforms
- Training entry → Task datasets: uses
- Training entry → Detection solver: starts training
- Training entry → Depth solver: starts training
- Training entry → Segmentation solver: starts training
- Detection solver → GTR backbone: runs model
- Depth solver → GTR backbone: runs model
- Segmentation solver → GTR backbone: runs model
- GTR backbone → Feature encoder: features
- Feature encoder → Detection model: features
- Feature encoder → Instance segmentation: features
- Feature encoder → Oriented detection: features
- Feature encoder → Pose model: features
- Feature encoder → Semantic segmentation: features
- Feature encoder → Depth model: features
- Depth solver → Depth evaluation: evaluates
- Depth evaluation → Predictions and metrics: returns metrics
- Researcher → PyTorch inference: requests inference
- PyTorch inference → Predictions and metrics: produces
- Researcher → ONNX export: requests export
- ONNX export → ONNX model patches: applies patches
- ONNX export → TensorRT verification: exports model for
- TensorRT verification → Predictions and metrics: verifies outputs
