# zhaoj9014/anti-uav architecture

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

- Interactive diagram: https://gitdiagram.com/zhaoj9014/anti-uav
- Repository: https://github.com/zhaoj9014/anti-uav

## Overview

Anti-UAV is a computer-vision research repository for detecting and tracking UAVs in RGB and thermal video, with training and benchmark tooling and several PyTorch/Jittor implementations. A visible runtime path receives frames in the camera-link application, invokes detection and tracking, and can send target coordinates over UDP. The README also describes training and evaluation as product capabilities. The tree contains multiple independent implementations; unsampled subsystems are represented only where the README or source index supports their role, and the graph does not imply they form one pipeline.

Main entry points: [`Codes/detect_wrapper/Detectoruav.py`](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/Detectoruav.py) (UAV Detector), [`Codes/detect_tracking.py`](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_tracking.py) (Camera Link), [`Codes/detect_wrapper/models/experimental.py`](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/models/experimental.py) (YOLO Layers), [`Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py`](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py) (UAV Tracker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["Live Detection"]
  node_controller["Camera Link<br/>[detect_tracking.py]"]
end

subgraph group_models["Detection Models"]
  node_detector["UAV Detector<br/>[Detectoruav.py]"]
  node_yolo_layers["YOLO Layers<br/>[experimental.py]"]
  node_yolo_common["YOLO Components<br/>[common.py]"]
  node_image_data["Image Loading<br/>[datasets.py]"]
  node_postprocess["Detection Utilities<br/>[general.py]"]
  node_device["Device Utilities<br/>[torch_utils.py]"]
  node_jittor_predictor["Jittor Detector<br/>[dect_predict.py]"]
  node_rpn["Region Proposals<br/>[rpn.py]"]
  node_siamdt_handler["SiamDT Inference<br/>[mmdet_handler.py]"]
  node_mmdet_inference["Detector Inference API<br/>[inference.py]"]
end

subgraph group_tracking["Tracking"]
  node_tracker["UAV Tracker<br/>[tracker.py]"]
  node_fhog["FHOG Features<br/>[fhog.py]"]
end

subgraph group_research["Training and Evaluation"]
  node_training["Detector Training<br/>[train_drone.py]"]
  node_anti_dataset["Anti-UAV Dataset<br/>[antiuav410.py]"]
  node_evaluation["Tracking Evaluation"]
  node_metric["Tracking Metric"]
end

node_operator(("Video Source"))
node_udp(("Coordinate Receiver"))

node_operator -->|"sends frames"| node_controller
node_controller -->|"requests detection"| node_detector
node_controller -->|"uses tracker"| node_tracker
node_controller -->|"sends coordinates"| node_udp
node_detector -->|"loads models"| node_yolo_layers
node_detector -->|"loads images"| node_image_data
node_detector -->|"uses utilities"| node_postprocess
node_detector -->|"selects device"| node_device
node_yolo_layers -->|"uses layers"| node_yolo_common
node_tracker -->|"uses features"| node_fhog
node_siamdt_handler -->|"runs inference"| node_mmdet_inference
node_jittor_predictor -->|"constructs detector"| node_rpn
node_training -->|"initializes model"| node_yolo_layers
node_anti_dataset -.->|"evaluated by"| node_evaluation
node_evaluation -.->|"computes scores"| node_metric

click node_controller "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_tracking.py"
click node_detector "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/Detectoruav.py"
click node_yolo_layers "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/models/experimental.py"
click node_yolo_common "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/models/common.py"
click node_image_data "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/datasets.py"
click node_postprocess "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/general.py"
click node_device "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/torch_utils.py"
click node_tracker "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py"
click node_fhog "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/tracking_wrapper/drtracker/fhog.py"
click node_jittor_predictor "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/dectect/dect_predict.py"
click node_rpn "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/dectect/model/rpn.py"
click node_siamdt_handler "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/tools/deployment/mmdet_handler.py"
click node_mmdet_inference "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/mmdet/apis/inference.py"
click node_training "https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/train_drone.py"
click node_anti_dataset "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/datasets/antiuav410.py"
click node_evaluation "https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/Evaluation_for_ALL.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_controller toneBlue
class node_detector,node_yolo_layers,node_yolo_common,node_image_data,node_postprocess,node_device,node_jittor_predictor,node_rpn,node_siamdt_handler,node_mmdet_inference toneAmber
class node_tracker,node_fhog toneMint
class node_training,node_anti_dataset,node_evaluation,node_metric toneRose
class node_operator,node_udp toneIndigo
```

## Components

### Live Detection

- [Camera Link](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_tracking.py): `Codes/detect_tracking.py`

### Detection Models

- [UAV Detector](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/Detectoruav.py): `Codes/detect_wrapper/Detectoruav.py`
- [YOLO Layers](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/models/experimental.py): `Codes/detect_wrapper/models/experimental.py`
- [YOLO Components](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/models/common.py): `Codes/detect_wrapper/models/common.py`
- [Image Loading](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/datasets.py): `Codes/detect_wrapper/utils/datasets.py`
- [Detection Utilities](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/general.py): `Codes/detect_wrapper/utils/general.py`
- [Device Utilities](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/utils/torch_utils.py): `Codes/detect_wrapper/utils/torch_utils.py`
- [Jittor Detector](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/dectect/dect_predict.py): `anti_uav_jittor/dectect/dect_predict.py`
- [Region Proposals](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/dectect/model/rpn.py): `anti_uav_jittor/dectect/model/rpn.py`
- [SiamDT Inference](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/tools/deployment/mmdet_handler.py): `anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/tools/deployment/mmdet_handler.py`
- [Detector Inference API](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/mmdet/apis/inference.py): `anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/mmdet/apis/inference.py`

### Tracking

- [UAV Tracker](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py): `Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py`
- [FHOG Features](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/tracking_wrapper/drtracker/fhog.py): `Codes/tracking_wrapper/drtracker/fhog.py`

### Training and Evaluation

- [Detector Training](https://github.com/zhaoj9014/anti-uav/blob/master/Codes/detect_wrapper/train_drone.py): `Codes/detect_wrapper/train_drone.py`
- [Anti-UAV Dataset](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/datasets/antiuav410.py): `anti_uav_jittor/anti_uav410_jit/datasets/antiuav410.py`
- [Tracking Evaluation](https://github.com/zhaoj9014/anti-uav/blob/master/anti_uav_jittor/anti_uav410_jit/Evaluation_for_ALL.py): `anti_uav_jittor/anti_uav410_jit/Evaluation_for_ALL.py`
- **Tracking Metric**

### Other components

- **Video Source**
- **Coordinate Receiver**

## Connections

- Video Source → Camera Link: sends frames (evidence: `Codes/detect_tracking.py`)
- Camera Link → UAV Detector: requests detection (evidence: `Codes/detect_tracking.py`)
- Camera Link → UAV Tracker: uses tracker (evidence: `Codes/detect_tracking.py`)
- Camera Link → Coordinate Receiver: sends coordinates (evidence: `Codes/detect_tracking.py`)
- UAV Detector → YOLO Layers: loads models (evidence: `Codes/detect_wrapper/Detectoruav.py`)
- UAV Detector → Image Loading: loads images (evidence: `Codes/detect_wrapper/Detectoruav.py`)
- UAV Detector → Detection Utilities: uses utilities (evidence: `Codes/detect_wrapper/Detectoruav.py`)
- UAV Detector → Device Utilities: selects device (evidence: `Codes/detect_wrapper/Detectoruav.py`)
- YOLO Layers → YOLO Components: uses layers (evidence: `Codes/detect_wrapper/models/experimental.py`)
- UAV Tracker → FHOG Features: uses features (evidence: `Codes/tracking_wrapper/dronetracker/trackinguav/evaluation/tracker.py`)
- SiamDT Inference → Detector Inference API: runs inference (evidence: `anti_uav_jittor/anti_uav410_jit/trackers/SiamDT/libs/swintransformer/tools/deployment/mmdet_handler.py`)
- Jittor Detector → Region Proposals: constructs detector (evidence: `anti_uav_jittor/dectect/dect_predict.py`)
- Detector Training → YOLO Layers: initializes model (evidence: `Codes/detect_wrapper/train_drone.py`)
- Anti-UAV Dataset → Tracking Evaluation: evaluated by
- Tracking Evaluation → Tracking Metric: computes scores
