# aras62/piepredict architecture

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

- Interactive diagram: https://gitdiagram.com/aras62/piepredict
- Repository: https://github.com/aras62/piepredict

## Overview

This repository implements pedestrian intention estimation and trajectory prediction, with pretrained intention, speed, and trajectory models. The documented workflow is to supply PIE annotations and video data, train the models separately, or evaluate the combined intention-and-speed trajectory model. The sampled code shows intention image-feature preparation and model logic in `pie_intent.py`, trajectory data preparation and testing in `pie_predict.py`, and image helpers in `utils.py`. The training entry point and speed-model implementation were not sampled, so their internal wiring is not inferred.

Main entry points: [`train_test.py`](https://github.com/aras62/piepredict/blob/master/train_test.py) (Training and test entry point), [`pie_intent.py`](https://github.com/aras62/piepredict/blob/master/pie_intent.py) (Intention estimation), [`pie_predict.py`](https://github.com/aras62/piepredict/blob/master/pie_predict.py) (Combined model evaluation), [`data/pie/speed`](https://github.com/aras62/piepredict/tree/master/data/pie/speed) (Vehicle speed model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["PIE data"]
  node_pie_data[("PIE annotations and clips")]
  node_data_setup["Dataset setup<br/>[README.md]"]
end

subgraph group_models["Prediction models"]
  node_intention["Intention estimation<br/>[pie_intent.py]"]
  node_image_features["Image feature preparation<br/>[pie_intent.py]"]
  node_image_utils["Image preprocessing helpers<br/>[utils.py]"]
  node_speed["Vehicle speed model"]
  node_trajectory["Trajectory estimation<br/>[pie_predict.py]"]
end

subgraph group_workflow["Training and evaluation"]
  node_combined_eval["Combined model evaluation<br/>[pie_predict.py]"]
  node_train_test["Training and test entry point<br/>[train_test.py]"]
end

subgraph group_artifacts["Pretrained artifacts"]
  node_intent_weights["Intention model files"]
  node_speed_weights["Speed model files"]
  node_trajectory_weights["Trajectory model files"]
end

node_researcher(("Researcher"))

node_researcher -->|"sets up"| node_data_setup
node_data_setup -->|"uses"| node_pie_data
node_researcher -->|"runs"| node_train_test
node_train_test -->|"trains separately"| node_intention
node_train_test -->|"trains separately"| node_speed
node_train_test -->|"trains separately"| node_trajectory
node_intention -->|"generates"| node_image_features
node_image_features -->|"uses"| node_image_utils
node_combined_eval -->|"loads intents"| node_intention
node_combined_eval -->|"combines speed"| node_speed
node_combined_eval -->|"evaluates"| node_trajectory
node_intention -->|"saves model files"| node_intent_weights
node_speed -->|"provides pretrained model"| node_speed_weights
node_trajectory -->|"loads model files"| node_trajectory_weights

click node_data_setup "https://github.com/aras62/piepredict/blob/master/README.md"
click node_intention "https://github.com/aras62/piepredict/blob/master/pie_intent.py"
click node_image_features "https://github.com/aras62/piepredict/blob/master/pie_intent.py"
click node_image_utils "https://github.com/aras62/piepredict/blob/master/utils.py"
click node_speed "https://github.com/aras62/piepredict/tree/master/data/pie/speed"
click node_trajectory "https://github.com/aras62/piepredict/blob/master/pie_predict.py"
click node_combined_eval "https://github.com/aras62/piepredict/blob/master/pie_predict.py"
click node_train_test "https://github.com/aras62/piepredict/blob/master/train_test.py"
click node_intent_weights "https://github.com/aras62/piepredict/tree/master/data/pie/intention/context_loc_pretrained"
click node_speed_weights "https://github.com/aras62/piepredict/tree/master/data/pie/speed/speed_pretrained"
click node_trajectory_weights "https://github.com/aras62/piepredict/tree/master/data/pie/trajectory/loc_intent_speed_pretrained"

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_pie_data,node_data_setup toneBlue
class node_intention,node_image_features,node_image_utils,node_speed,node_trajectory toneAmber
class node_combined_eval,node_train_test toneMint
class node_intent_weights,node_speed_weights,node_trajectory_weights toneRose
class node_researcher toneIndigo
```

## Components

### PIE data

- **PIE annotations and clips**
- [Dataset setup](https://github.com/aras62/piepredict/blob/master/README.md): `README.md`

### Prediction models

- [Intention estimation](https://github.com/aras62/piepredict/blob/master/pie_intent.py): `pie_intent.py`
- [Image feature preparation](https://github.com/aras62/piepredict/blob/master/pie_intent.py): `pie_intent.py`
- [Image preprocessing helpers](https://github.com/aras62/piepredict/blob/master/utils.py): `utils.py`
- [Vehicle speed model](https://github.com/aras62/piepredict/tree/master/data/pie/speed): `data/pie/speed`
- [Trajectory estimation](https://github.com/aras62/piepredict/blob/master/pie_predict.py): `pie_predict.py`

### Training and evaluation

- [Combined model evaluation](https://github.com/aras62/piepredict/blob/master/pie_predict.py): `pie_predict.py`
- [Training and test entry point](https://github.com/aras62/piepredict/blob/master/train_test.py): `train_test.py`

### Pretrained artifacts

- [Intention model files](https://github.com/aras62/piepredict/tree/master/data/pie/intention/context_loc_pretrained): `data/pie/intention/context_loc_pretrained`
- [Speed model files](https://github.com/aras62/piepredict/tree/master/data/pie/speed/speed_pretrained): `data/pie/speed/speed_pretrained`
- [Trajectory model files](https://github.com/aras62/piepredict/tree/master/data/pie/trajectory/loc_intent_speed_pretrained): `data/pie/trajectory/loc_intent_speed_pretrained`

### Other components

- **Researcher**

## Connections

- Researcher → Dataset setup: sets up (evidence: `README.md`)
- Dataset setup → PIE annotations and clips: uses (evidence: `README.md`)
- Researcher → Training and test entry point: runs (evidence: `README.md`)
- Training and test entry point → Intention estimation: trains separately (evidence: `README.md`)
- Training and test entry point → Vehicle speed model: trains separately (evidence: `README.md`)
- Training and test entry point → Trajectory estimation: trains separately (evidence: `README.md`)
- Intention estimation → Image feature preparation: generates (evidence: `pie_intent.py`)
- Image feature preparation → Image preprocessing helpers: uses (evidence: `pie_intent.py`)
- Combined model evaluation → Intention estimation: loads intents (evidence: `pie_predict.py`)
- Combined model evaluation → Vehicle speed model: combines speed (evidence: `README.md`)
- Combined model evaluation → Trajectory estimation: evaluates (evidence: `README.md`)
- Intention estimation → Intention model files: saves model files (evidence: `pie_intent.py`)
- Vehicle speed model → Speed model files: provides pretrained model (evidence: `README.md`)
- Trajectory estimation → Trajectory model files: loads model files (evidence: `pie_predict.py`)
