# tensorflow/models architecture

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

- Interactive diagram: https://gitdiagram.com/tensorflow/models
- Repository: https://github.com/tensorflow/models

## Overview

TensorFlow Model Garden is a collection of TensorFlow model implementations and modeling solutions, with officially maintained TensorFlow 2 examples, researcher-maintained implementations, and Orbit training-loop utilities. A representative workflow configures a task, supplies data, runs model training or evaluation, and may export results; the repository also includes specialized recommendation and cloud-inference applications. The tree and README establish these product areas, but sampled source is limited, so unverified cross-module workflows are not asserted.

Main entry points: [`official/legacy/detection/main.py`](https://github.com/tensorflow/models/blob/master/official/legacy/detection/main.py) (Detection executor), [`official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py`](https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py) (Image inference workflow), [`official/nlp/train.py`](https://github.com/tensorflow/models/blob/master/official/nlp/train.py) (NLP training), [`official/core/config_definitions.py`](https://github.com/tensorflow/models/blob/master/official/core/config_definitions.py) (Experiment config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared training"]
  node_config["Experiment config"]
end

subgraph group_nlp["Language models"]
  node_nlp_data["NLP data"]
  node_nlp_models["NLP tasks and models"]
  node_nlp_train["NLP training<br/>[train.py]"]
  node_nlp_serve["NLP serving"]
end

subgraph group_vision["Vision models"]
  node_det_config["Detection configs<br/>[factory.py]"]
  node_det_data["Detection input<br/>[input_reader.py]"]
  node_det_model["Detection models<br/>[factory.py]"]
  node_det_run["Detection executor<br/>[main.py]"]
  node_det_eval["Detection evaluation"]
end

subgraph group_rec["Recommendation"]
  node_rec_data["Recommendation data<br/>[data_pipeline.py]"]
  node_rank_data["Ranking data<br/>[data_pipeline.py]"]
  node_waste_flow["Image inference workflow"]
  node_tracker["Object tracking<br/>[object_tracking.py]"]
  node_triton["Triton inference"]
  node_bigquery[("BigQuery storage<br/>[big_query_ops.py]")]
end

subgraph group_orbit["Orbit loops"]
  node_controller["Training controller<br/>[controller.py]"]
  node_orbit_summary["Summary manager<br/>[summary_manager.py]"]
end

node_user(("TensorFlow user"))
node_research["Research implementations"]

node_user -.->|"configures"| node_config
node_user -.->|"uses models"| node_nlp_train
node_user -.->|"runs models"| node_det_run
node_user -.->|"uses models"| node_rec_data
node_user -.->|"explores models"| node_research
node_config -.->|"defines options"| node_det_config
node_det_run -->|"loads configs"| node_det_config
node_det_run -->|"builds model"| node_det_model
node_det_run -->|"uses input"| node_det_data
node_det_run -.->|"evaluates"| node_det_eval
node_nlp_data -.->|"supplies data"| node_nlp_train
node_nlp_train -.->|"trains"| node_nlp_models
node_nlp_models -.->|"exports"| node_nlp_serve
node_rec_data -.->|"supports ranking"| node_rank_data
node_waste_flow -->|"tracks objects"| node_tracker
node_waste_flow -->|"requests inference"| node_triton
node_waste_flow -->|"stores results"| node_bigquery
node_controller -.->|"reports summaries"| node_orbit_summary

click node_config "https://github.com/tensorflow/models/blob/master/official/core/config_definitions.py"
click node_nlp_data "https://github.com/tensorflow/models/tree/master/official/nlp/data"
click node_nlp_models "https://github.com/tensorflow/models/tree/master/official/nlp/modeling/models"
click node_nlp_train "https://github.com/tensorflow/models/blob/master/official/nlp/train.py"
click node_nlp_serve "https://github.com/tensorflow/models/blob/master/official/nlp/serving/export_savedmodel.py"
click node_det_config "https://github.com/tensorflow/models/blob/master/official/legacy/detection/configs/factory.py"
click node_det_data "https://github.com/tensorflow/models/blob/master/official/legacy/detection/dataloader/input_reader.py"
click node_det_model "https://github.com/tensorflow/models/blob/master/official/legacy/detection/modeling/factory.py"
click node_det_run "https://github.com/tensorflow/models/blob/master/official/legacy/detection/main.py"
click node_det_eval "https://github.com/tensorflow/models/tree/master/official/legacy/detection/evaluation"
click node_rec_data "https://github.com/tensorflow/models/blob/master/official/recommendation/data_pipeline.py"
click node_rank_data "https://github.com/tensorflow/models/blob/master/official/recommendation/ranking/data/data_pipeline.py"
click node_waste_flow "https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py"
click node_tracker "https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/object_tracking.py"
click node_triton "https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/triton_server_inference.py"
click node_bigquery "https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/big_query_ops.py"
click node_controller "https://github.com/tensorflow/models/blob/master/orbit/controller.py"
click node_orbit_summary "https://github.com/tensorflow/models/blob/master/orbit/utils/summary_manager.py"
click node_research "https://github.com/tensorflow/models/tree/master/research"

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_config,node_user toneBlue
class node_nlp_data,node_nlp_models,node_nlp_train,node_nlp_serve toneAmber
class node_det_config,node_det_data,node_det_model,node_det_run,node_det_eval toneMint
class node_rec_data,node_rank_data,node_waste_flow,node_tracker,node_triton,node_bigquery toneRose
class node_controller,node_orbit_summary toneIndigo
class node_research toneTeal
```

## Components

### Shared training

- [Experiment config](https://github.com/tensorflow/models/blob/master/official/core/config_definitions.py): `official/core/config_definitions.py`

### Language models

- [NLP data](https://github.com/tensorflow/models/tree/master/official/nlp/data): `official/nlp/data`
- [NLP tasks and models](https://github.com/tensorflow/models/tree/master/official/nlp/modeling/models): `official/nlp/modeling/models`
- [NLP training](https://github.com/tensorflow/models/blob/master/official/nlp/train.py): `official/nlp/train.py`
- [NLP serving](https://github.com/tensorflow/models/blob/master/official/nlp/serving/export_savedmodel.py): `official/nlp/serving/export_savedmodel.py`

### Vision models

- [Detection configs](https://github.com/tensorflow/models/blob/master/official/legacy/detection/configs/factory.py): `official/legacy/detection/configs/factory.py`
- [Detection input](https://github.com/tensorflow/models/blob/master/official/legacy/detection/dataloader/input_reader.py): `official/legacy/detection/dataloader/input_reader.py`
- [Detection models](https://github.com/tensorflow/models/blob/master/official/legacy/detection/modeling/factory.py): `official/legacy/detection/modeling/factory.py`
- [Detection executor](https://github.com/tensorflow/models/blob/master/official/legacy/detection/main.py): `official/legacy/detection/main.py`
- [Detection evaluation](https://github.com/tensorflow/models/tree/master/official/legacy/detection/evaluation): `official/legacy/detection/evaluation`

### Recommendation

- [Recommendation data](https://github.com/tensorflow/models/blob/master/official/recommendation/data_pipeline.py): `official/recommendation/data_pipeline.py`
- [Ranking data](https://github.com/tensorflow/models/blob/master/official/recommendation/ranking/data/data_pipeline.py): `official/recommendation/ranking/data/data_pipeline.py`
- [Image inference workflow](https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py): `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py`
- [Object tracking](https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/object_tracking.py): `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/object_tracking.py`
- [Triton inference](https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/triton_server_inference.py): `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/triton_server_inference.py`
- [BigQuery storage](https://github.com/tensorflow/models/blob/master/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/big_query_ops.py): `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/big_query_ops.py`

### Orbit loops

- [Training controller](https://github.com/tensorflow/models/blob/master/orbit/controller.py): `orbit/controller.py`
- [Summary manager](https://github.com/tensorflow/models/blob/master/orbit/utils/summary_manager.py): `orbit/utils/summary_manager.py`

### Other components

- **TensorFlow user**
- [Research implementations](https://github.com/tensorflow/models/tree/master/research): `research`

## Connections

- TensorFlow user → Experiment config: configures
- TensorFlow user → NLP training: uses models
- TensorFlow user → Detection executor: runs models
- TensorFlow user → Recommendation data: uses models
- TensorFlow user → Research implementations: explores models
- Experiment config → Detection configs: defines options
- Detection executor → Detection configs: loads configs (evidence: `official/legacy/detection/main.py`)
- Detection executor → Detection models: builds model (evidence: `official/legacy/detection/main.py`)
- Detection executor → Detection input: uses input (evidence: `official/legacy/detection/main.py`)
- Detection executor → Detection evaluation: evaluates
- NLP data → NLP training: supplies data
- NLP training → NLP tasks and models: trains
- NLP tasks and models → NLP serving: exports
- Recommendation data → Ranking data: supports ranking
- Image inference workflow → Object tracking: tracks objects (evidence: `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py`)
- Image inference workflow → Triton inference: requests inference (evidence: `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py`)
- Image inference workflow → BigQuery storage: stores results (evidence: `official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py`)
- Training controller → Summary manager: reports summaries
