# jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking architecture

> Architecture diagram of the GitHub repository jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking
- Repository: https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking

## Overview

This is a Keras-based UAV video detector and tracker. The primary workflow reads video frames, estimates background motion, extracts candidate patches and motion features, classifies candidates, then tracks detections and writes annotated video and detection text. Ground-truth annotations support evaluation and visualization. The model directories hold appearance, motion, and AdaBoost artifacts used by the workflow. The sampled excerpts show the main loop and several utility implementations, but omit portions of main.py, so uncertain call wiring is left out.

Main entry points: [`main.py`](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/main.py) (Frame pipeline), [`util/Detect_Patch.py`](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Detect_Patch.py) (Detection tracking), [`Data/Annotation_update_180925`](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/Data/Annotation_update_180925) (Ground truth), [`util/Generate_pm_pa.py`](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Generate_pm_pa.py) (Motion features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Video workflow"]
  node_main["Frame pipeline<br/>[main.py]"]
  node_detect["Detection tracking<br/>[Detect_Patch.py]"]
end

subgraph group_vision["Vision utilities"]
  node_motion["Motion features<br/>[Generate_pm_pa.py]"]
  node_patches["Patch extraction<br/>[Extract_Patch.py]"]
  node_visioncore["Motion and features"]
  node_kalman["Kalman filter<br/>[kalman2d.py]"]
end

subgraph group_models["Detection models"]
  node_appearance["Appearance models"]
  node_motionmodel["Motion models"]
  node_trackappearance["Tracking appearance"]
  node_adaboost["AdaBoost models"]
  node_trackboost["Tracking AdaBoost"]
end

subgraph group_results["Inputs and results"]
  node_video["Input video"]
  node_groundtruth["Ground truth"]
  node_output["Detection outputs"]
  node_annotated["Annotated video"]
end

node_operator(("User"))

node_operator -->|"runs"| node_main
node_video -->|"frames"| node_main
node_groundtruth -.->|"annotations"| node_main
node_main -->|"generates candidates"| node_motion
node_main -->|"extracts patches"| node_patches
node_main -->|"estimates motion"| node_visioncore
node_main -->|"predicts appearance"| node_appearance
node_main -->|"predicts motion"| node_motionmodel
node_main -->|"scores tracks"| node_trackappearance
node_main -->|"combines scores"| node_adaboost
node_main -->|"scores tracks"| node_trackboost
node_main -->|"updates detections"| node_detect
node_detect -->|"filters motion"| node_kalman
node_main -->|"writes detections"| node_output
node_main -->|"writes video"| node_annotated

click node_groundtruth "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/Data/Annotation_update_180925"
click node_main "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/main.py"
click node_motion "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Generate_pm_pa.py"
click node_patches "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Extract_Patch.py"
click node_visioncore "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/UAV_subfunctions.py"
click node_detect "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Detect_Patch.py"
click node_kalman "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/kalman2d.py"
click node_appearance "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Appearance_OriImage"
click node_motionmodel "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/motion"
click node_trackappearance "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/max500_1_10_threelayers"
click node_adaboost "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Adaboost"
click node_trackboost "https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Adaboost_track"

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_main,node_detect,node_operator toneBlue
class node_motion,node_patches,node_visioncore,node_kalman toneAmber
class node_appearance,node_motionmodel,node_trackappearance,node_adaboost,node_trackboost toneMint
class node_video,node_groundtruth,node_output,node_annotated toneRose
```

## Components

### Video workflow

- [Frame pipeline](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/main.py): `main.py`
- [Detection tracking](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Detect_Patch.py): `util/Detect_Patch.py`

### Vision utilities

- [Motion features](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Generate_pm_pa.py): `util/Generate_pm_pa.py`
- [Patch extraction](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/Extract_Patch.py): `util/Extract_Patch.py`
- [Motion and features](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/UAV_subfunctions.py): `util/UAV_subfunctions.py`
- [Kalman filter](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/blob/master/util/kalman2d.py): `util/kalman2d.py`

### Detection models

- [Appearance models](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Appearance_OriImage): `models/Appearance_OriImage`
- [Motion models](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/motion): `models/motion`
- [Tracking appearance](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/max500_1_10_threelayers): `models/max500_1_10_threelayers`
- [AdaBoost models](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Adaboost): `models/Adaboost`
- [Tracking AdaBoost](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/models/Adaboost_track): `models/Adaboost_track`

### Inputs and results

- **Input video**
- [Ground truth](https://github.com/jingliinpurdue/fast-and-robust-uav-to-uav-detection-and-tracking/tree/master/Data/Annotation_update_180925): `Data/Annotation_update_180925`
- **Detection outputs**
- **Annotated video**

### Other components

- **User**

## Connections

- User → Frame pipeline: runs
- Input video → Frame pipeline: frames
- Ground truth → Frame pipeline: annotations
- Frame pipeline → Motion features: generates candidates
- Frame pipeline → Patch extraction: extracts patches
- Frame pipeline → Motion and features: estimates motion
- Frame pipeline → Appearance models: predicts appearance
- Frame pipeline → Motion models: predicts motion
- Frame pipeline → Tracking appearance: scores tracks
- Frame pipeline → AdaBoost models: combines scores
- Frame pipeline → Tracking AdaBoost: scores tracks
- Frame pipeline → Detection tracking: updates detections
- Detection tracking → Kalman filter: filters motion
- Frame pipeline → Detection outputs: writes detections
- Frame pipeline → Annotated video: writes video
