# rs9313399-dot/animal-detector-yolo architecture

> Architecture diagram of the GitHub repository rs9313399-dot/animal-detector-yolo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rs9313399-dot/animal-detector-yolo
- Repository: https://github.com/rs9313399-dot/animal-detector-yolo

## Overview

FAUNA’s main workflow is an observer using the browser dashboard and live studio to submit camera frames, receive YOLO detections, and optionally save captures for later review. The platform also includes species reference and system configuration, plus a separate dataset validation, training, and benchmarking workflow. Some UI and backend modules were not excerpted; links to those capabilities rely on the README or SOURCE INDEX references.

Main entry points: [`frontend/src/App.tsx`](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/App.tsx) (Application shell), [`frontend/src/services/api.ts`](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/services/api.ts) (API client), [`backend/detector.py`](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/detector.py) (YOLO detector), [`frontend/src/components/LiveStudio.tsx`](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/LiveStudio.tsx) (Live studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Observer Interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_studio["Live studio<br/>[LiveStudio.tsx]"]
  node_history["Capture gallery<br/>[HistoryGallery.tsx]"]
  node_capture_modal["Capture inspection<br/>[CaptureModal.tsx]"]
  node_settings["System settings<br/>[SettingsView.tsx]"]
  node_explorer["Species explorer<br/>[AnimalExplorer.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_audio["Audio alerts<br/>[audio.ts]"]
end

subgraph group_backend["Detection Platform"]
  node_api["FastAPI routes<br/>[app.py]"]
  node_detector["YOLO detector<br/>[detector.py]"]
  node_detection_logic["Detection filtering<br/>[detection_logic.py]"]
  node_config["Model and class config<br/>[config.py]"]
  node_captures["Capture management<br/>[captures.py]"]
  node_vault[("Capture files")]
end

subgraph group_training["Model Development"]
  node_dataset[("Labeled datasets")]
  node_pipeline["Training pipeline<br/>[animal_pipeline.py]"]
  node_model_weights["YOLO weights<br/>[yolov8n.pt]"]
end

subgraph group_reference["Species Reference"]
  node_species_data["Species dossiers<br/>[animals.ts]"]
end

node_observer(("Field observer"))

node_observer -->|"uses"| node_app
node_app -->|"shows"| node_dashboard
node_app -->|"shows"| node_studio
node_app -->|"shows"| node_history
node_app -->|"shows"| node_explorer
node_app -->|"shows"| node_settings
node_app -->|"opens"| node_capture_modal
node_app -->|"loads settings"| node_api_client
node_studio -->|"submits frames"| node_api_client
node_studio -->|"plays alerts"| node_audio
node_history -->|"loads captures"| node_api_client
node_settings -->|"saves settings"| node_api_client
node_explorer -->|"reads dossiers"| node_species_data
node_api_client -->|"requests data"| node_api
node_api -->|"runs inference"| node_detector
node_api -->|"manages captures"| node_captures
node_detector -->|"uses settings"| node_config
node_detector -->|"delegates filtering"| node_detection_logic
node_captures -->|"uses paths"| node_config
node_captures -.->|"reads and writes"| node_vault
node_detector -.->|"loads model"| node_model_weights
node_dataset -.->|"provides labels"| node_pipeline
node_pipeline -->|"uses class definitions"| node_config
node_pipeline -.->|"fine-tunes weights"| node_model_weights

click node_app "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/Dashboard.tsx"
click node_studio "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/LiveStudio.tsx"
click node_history "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/HistoryGallery.tsx"
click node_capture_modal "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/CaptureModal.tsx"
click node_settings "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/SettingsView.tsx"
click node_explorer "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/AnimalExplorer.tsx"
click node_api_client "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/services/api.ts"
click node_audio "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/services/audio.ts"
click node_species_data "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/constants/animals.ts"
click node_api "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/app.py"
click node_detector "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/detector.py"
click node_detection_logic "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/detection_logic.py"
click node_config "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/config.py"
click node_captures "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/captures.py"
click node_vault "https://github.com/rs9313399-dot/animal-detector-yolo/tree/main/backend"
click node_dataset "https://github.com/rs9313399-dot/animal-detector-yolo/tree/main/datasets"
click node_pipeline "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/tools/animal_pipeline.py"
click node_model_weights "https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/yolov8n.pt"

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_app,node_dashboard,node_studio,node_history,node_capture_modal,node_settings,node_explorer,node_api_client,node_audio toneBlue
class node_api,node_detector,node_detection_logic,node_config,node_captures,node_vault toneAmber
class node_dataset,node_pipeline,node_model_weights,node_observer toneMint
class node_species_data toneRose
```

## Components

### Observer Interface

- [Application shell](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/Dashboard.tsx): `frontend/src/components/Dashboard.tsx`
- [Live studio](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/LiveStudio.tsx): `frontend/src/components/LiveStudio.tsx`
- [Capture gallery](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/HistoryGallery.tsx): `frontend/src/components/HistoryGallery.tsx`
- [Capture inspection](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/CaptureModal.tsx): `frontend/src/components/CaptureModal.tsx`
- [System settings](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/SettingsView.tsx): `frontend/src/components/SettingsView.tsx`
- [Species explorer](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/components/AnimalExplorer.tsx): `frontend/src/components/AnimalExplorer.tsx`
- [API client](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Audio alerts](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/services/audio.ts): `frontend/src/services/audio.ts`

### Detection Platform

- [FastAPI routes](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/app.py): `backend/app.py`
- [YOLO detector](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/detector.py): `backend/detector.py`
- [Detection filtering](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/detection_logic.py): `backend/detection_logic.py`
- [Model and class config](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/config.py): `backend/config.py`
- [Capture management](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/backend/captures.py): `backend/captures.py`
- [Capture files](https://github.com/rs9313399-dot/animal-detector-yolo/tree/main/backend): `backend`

### Model Development

- [Labeled datasets](https://github.com/rs9313399-dot/animal-detector-yolo/tree/main/datasets): `datasets`
- [Training pipeline](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/tools/animal_pipeline.py): `tools/animal_pipeline.py`
- [YOLO weights](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/yolov8n.pt): `yolov8n.pt`

### Species Reference

- [Species dossiers](https://github.com/rs9313399-dot/animal-detector-yolo/blob/main/frontend/src/constants/animals.ts): `frontend/src/constants/animals.ts`

### Other components

- **Field observer**

## Connections

- Field observer → Application shell: uses (evidence: `README.md`)
- Application shell → Dashboard: shows (evidence: `frontend/src/App.tsx`)
- Application shell → Live studio: shows (evidence: `frontend/src/App.tsx`)
- Application shell → Capture gallery: shows (evidence: `frontend/src/App.tsx`)
- Application shell → Species explorer: shows (evidence: `frontend/src/App.tsx`)
- Application shell → System settings: shows (evidence: `frontend/src/App.tsx`)
- Application shell → Capture inspection: opens (evidence: `frontend/src/App.tsx`)
- Application shell → API client: loads settings (evidence: `frontend/src/App.tsx`)
- Live studio → API client: submits frames (evidence: `frontend/src/components/LiveStudio.tsx`)
- Live studio → Audio alerts: plays alerts (evidence: `frontend/src/components/LiveStudio.tsx`)
- Capture gallery → API client: loads captures (evidence: `frontend/src/components/HistoryGallery.tsx`)
- System settings → API client: saves settings (evidence: `frontend/src/components/SettingsView.tsx`)
- Species explorer → Species dossiers: reads dossiers (evidence: `frontend/src/components/AnimalExplorer.tsx`)
- API client → FastAPI routes: requests data (evidence: `frontend/src/services/api.ts`)
- FastAPI routes → YOLO detector: runs inference (evidence: `backend/app.py`)
- FastAPI routes → Capture management: manages captures (evidence: `backend/app.py`)
- YOLO detector → Model and class config: uses settings (evidence: `backend/detector.py`)
- YOLO detector → Detection filtering: delegates filtering (evidence: `backend/detector.py`)
- Capture management → Model and class config: uses paths (evidence: `backend/captures.py`)
- Capture management → Capture files: reads and writes (evidence: `backend/captures.py`)
- YOLO detector → YOLO weights: loads model
- Labeled datasets → Training pipeline: provides labels
- Training pipeline → Model and class config: uses class definitions (evidence: `tools/animal_pipeline.py`)
- Training pipeline → YOLO weights: fine-tunes weights
