# zsniko/ednet architecture

> Architecture diagram of the GitHub repository zsniko/ednet, 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/zsniko/ednet
- Repository: https://github.com/zsniko/ednet

## Overview

EDNet is an edge-oriented small-object detector for UAV imagery, built on an Ultralytics-style YOLO framework. The principal workflow is to construct a model, prepare and augment labeled data, train it, validate detection quality, run predictions and inspect results, then export for deployment. The README also describes dataset exploration and mobile/CoreML use. Paths and links reflect the supplied tree, excerpts, and documented API; unsampled implementation details are represented only where the tree or README supports them.

Main entry points: [`ednet/__init__.py`](https://github.com/zsniko/ednet/blob/main/ednet/__init__.py) (EDNet API), [`ednet/engine/trainer.py`](https://github.com/zsniko/ednet/blob/main/ednet/engine/trainer.py) (Training engine), [`ednet/data/build.py`](https://github.com/zsniko/ednet/blob/main/ednet/data/build.py) (Dataset builder), [`ednet/nn/tasks.py`](https://github.com/zsniko/ednet/blob/main/ednet/nn/tasks.py) (Task model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Model API"]
  node_api["EDNet API<br/>[__init__.py]"]
  node_yolo_model["YOLO model<br/>[model.py]"]
end

subgraph group_data["Data preparation"]
  node_data_build["Dataset builder<br/>[build.py]"]
  node_dataset["Dataset<br/>[dataset.py]"]
  node_loaders["Data loaders<br/>[loaders.py]"]
  node_augment["Augmentation<br/>[augment.py]"]
end

subgraph group_runtime["Model runtime"]
  node_model_tasks["Task model<br/>[tasks.py]"]
  node_nn_blocks["Network blocks<br/>[block.py]"]
  node_trainer["Training engine<br/>[trainer.py]"]
  node_detect_train["Detection training<br/>[train.py]"]
  node_loss["Training losses<br/>[loss.py]"]
end

subgraph group_evaluation["Evaluation and deployment"]
  node_validator["Validation engine<br/>[validator.py]"]
  node_detect_val["Detection validation<br/>[val.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_predictor["Prediction engine<br/>[predictor.py]"]
  node_detect_predict["Detection prediction<br/>[predict.py]"]
  node_results["Prediction results<br/>[results.py]"]
  node_exporter["Model exporter<br/>[exporter.py]"]
end

subgraph group_exploration["Data exploration"]
  node_explorer["Dataset explorer<br/>[explorer.py]"]
end

node_user(("Engineer"))
node_vector_store[("LanceDB")]
node_comet["Comet ML"]
node_coreml["CoreML runtime"]

node_user -->|"uses"| node_api
node_api -->|"constructs"| node_yolo_model
node_yolo_model -->|"builds task"| node_model_tasks
node_model_tasks -->|"assembles"| node_nn_blocks
node_api -->|"trains"| node_trainer
node_trainer -->|"builds data"| node_data_build
node_data_build -->|"creates"| node_dataset
node_data_build -->|"creates loaders"| node_loaders
node_dataset -->|"transforms with"| node_augment
node_trainer -->|"dispatches"| node_detect_train
node_detect_train -->|"trains"| node_model_tasks
node_detect_train -->|"computes loss"| node_loss
node_api -->|"validates"| node_validator
node_validator -->|"builds data"| node_data_build
node_validator -->|"dispatches"| node_detect_val
node_detect_val -->|"updates"| node_metrics
node_api -->|"predicts"| node_predictor
node_predictor -->|"dispatches"| node_detect_predict
node_detect_predict -->|"runs inference"| node_model_tasks
node_detect_predict -->|"returns"| node_results
node_api -->|"exports"| node_exporter
node_exporter -.->|"exports for"| node_coreml
node_user -->|"explores data"| node_explorer
node_explorer -->|"reads images"| node_dataset
node_explorer -->|"writes embeddings"| node_vector_store
node_trainer -.->|"logs experiments"| node_comet

click node_api "https://github.com/zsniko/ednet/blob/main/ednet/__init__.py"
click node_yolo_model "https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/model.py"
click node_model_tasks "https://github.com/zsniko/ednet/blob/main/ednet/nn/tasks.py"
click node_nn_blocks "https://github.com/zsniko/ednet/blob/main/ednet/nn/modules/block.py"
click node_data_build "https://github.com/zsniko/ednet/blob/main/ednet/data/build.py"
click node_dataset "https://github.com/zsniko/ednet/blob/main/ednet/data/dataset.py"
click node_loaders "https://github.com/zsniko/ednet/blob/main/ednet/data/loaders.py"
click node_augment "https://github.com/zsniko/ednet/blob/main/ednet/data/augment.py"
click node_trainer "https://github.com/zsniko/ednet/blob/main/ednet/engine/trainer.py"
click node_detect_train "https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/train.py"
click node_loss "https://github.com/zsniko/ednet/blob/main/ednet/utils/loss.py"
click node_validator "https://github.com/zsniko/ednet/blob/main/ednet/engine/validator.py"
click node_detect_val "https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/val.py"
click node_metrics "https://github.com/zsniko/ednet/blob/main/ednet/utils/metrics.py"
click node_predictor "https://github.com/zsniko/ednet/blob/main/ednet/engine/predictor.py"
click node_detect_predict "https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/predict.py"
click node_results "https://github.com/zsniko/ednet/blob/main/ednet/engine/results.py"
click node_exporter "https://github.com/zsniko/ednet/blob/main/ednet/engine/exporter.py"
click node_explorer "https://github.com/zsniko/ednet/blob/main/ednet/data/explorer/explorer.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_api,node_yolo_model toneBlue
class node_data_build,node_dataset,node_loaders,node_augment,node_vector_store toneAmber
class node_model_tasks,node_nn_blocks,node_trainer,node_detect_train,node_loss toneMint
class node_validator,node_detect_val,node_metrics,node_predictor,node_detect_predict,node_results,node_exporter toneRose
class node_explorer,node_user,node_comet,node_coreml toneIndigo
```

## Components

### Model API

- [EDNet API](https://github.com/zsniko/ednet/blob/main/ednet/__init__.py): `ednet/__init__.py`
- [YOLO model](https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/model.py): `ednet/models/yolo/model.py`

### Data preparation

- [Dataset builder](https://github.com/zsniko/ednet/blob/main/ednet/data/build.py): `ednet/data/build.py`
- [Dataset](https://github.com/zsniko/ednet/blob/main/ednet/data/dataset.py): `ednet/data/dataset.py`
- [Data loaders](https://github.com/zsniko/ednet/blob/main/ednet/data/loaders.py): `ednet/data/loaders.py`
- [Augmentation](https://github.com/zsniko/ednet/blob/main/ednet/data/augment.py): `ednet/data/augment.py`

### Model runtime

- [Task model](https://github.com/zsniko/ednet/blob/main/ednet/nn/tasks.py): `ednet/nn/tasks.py`
- [Network blocks](https://github.com/zsniko/ednet/blob/main/ednet/nn/modules/block.py): `ednet/nn/modules/block.py`
- [Training engine](https://github.com/zsniko/ednet/blob/main/ednet/engine/trainer.py): `ednet/engine/trainer.py`
- [Detection training](https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/train.py): `ednet/models/yolo/detect/train.py`
- [Training losses](https://github.com/zsniko/ednet/blob/main/ednet/utils/loss.py): `ednet/utils/loss.py`

### Evaluation and deployment

- [Validation engine](https://github.com/zsniko/ednet/blob/main/ednet/engine/validator.py): `ednet/engine/validator.py`
- [Detection validation](https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/val.py): `ednet/models/yolo/detect/val.py`
- [Evaluation metrics](https://github.com/zsniko/ednet/blob/main/ednet/utils/metrics.py): `ednet/utils/metrics.py`
- [Prediction engine](https://github.com/zsniko/ednet/blob/main/ednet/engine/predictor.py): `ednet/engine/predictor.py`
- [Detection prediction](https://github.com/zsniko/ednet/blob/main/ednet/models/yolo/detect/predict.py): `ednet/models/yolo/detect/predict.py`
- [Prediction results](https://github.com/zsniko/ednet/blob/main/ednet/engine/results.py): `ednet/engine/results.py`
- [Model exporter](https://github.com/zsniko/ednet/blob/main/ednet/engine/exporter.py): `ednet/engine/exporter.py`

### Data exploration

- [Dataset explorer](https://github.com/zsniko/ednet/blob/main/ednet/data/explorer/explorer.py): `ednet/data/explorer/explorer.py`

### Other components

- **Engineer**
- **LanceDB**
- **Comet ML**
- **CoreML runtime**

## Connections

- Engineer → EDNet API: uses
- EDNet API → YOLO model: constructs
- YOLO model → Task model: builds task
- Task model → Network blocks: assembles
- EDNet API → Training engine: trains
- Training engine → Dataset builder: builds data
- Dataset builder → Dataset: creates
- Dataset builder → Data loaders: creates loaders
- Dataset → Augmentation: transforms with
- Training engine → Detection training: dispatches
- Detection training → Task model: trains
- Detection training → Training losses: computes loss
- EDNet API → Validation engine: validates
- Validation engine → Dataset builder: builds data
- Validation engine → Detection validation: dispatches
- Detection validation → Evaluation metrics: updates
- EDNet API → Prediction engine: predicts
- Prediction engine → Detection prediction: dispatches
- Detection prediction → Task model: runs inference
- Detection prediction → Prediction results: returns
- EDNet API → Model exporter: exports
- Model exporter → CoreML runtime: exports for
- Engineer → Dataset explorer: explores data
- Dataset explorer → Dataset: reads images
- Dataset explorer → LanceDB: writes embeddings
- Training engine → Comet ML: logs experiments
