# andreinacoding/dataset_agar architecture

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

- Interactive diagram: https://gitdiagram.com/andreinacoding/dataset_agar
- Repository: https://github.com/andreinacoding/dataset_agar

## Overview

AgarVision AI is a desktop application for analyzing agar-plate photos: users load a plate, detect and identify colonies, inspect segmented contours and organism details, and export measurements or batch results. Manual corrections can be retained for active learning, while analysis history supports reopening prior results. The repository also includes AGAR dataset preparation and YOLO training scripts. Edges involving app integrations are supported by the README and SOURCE INDEX references; unsampled internal behavior is represented only where documented.

Main entry points: [`app_agar.py`](https://github.com/andreinacoding/dataset_agar/blob/main/app_agar.py) (AgarVision app), [`analisi_agar.py`](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py) (Plate analysis), [`storico_agar.py`](https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py) (Analysis history), [`converti_yolo.py`](https://github.com/andreinacoding/dataset_agar/blob/main/converti_yolo.py) (YOLO conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Desktop analysis"]
  node_desktop["AgarVision app<br/>[app_agar.py]"]
  node_translations["Translations and facts<br/>[lingue_agar.py]"]
end

subgraph group_analysis["Image analysis"]
  node_analysis_engine["Plate analysis<br/>[analisi_agar.py]"]
  node_yolo["YOLO detector<br/>[analisi_agar.py]"]
  node_sam["SAM2 contours<br/>[analisi_agar.py]"]
  node_plate_metrics["Plate and CFU metrics<br/>[analisi_agar.py]"]
  node_batch["Batch analysis<br/>[analisi_agar.py]"]
  node_csv["CSV export<br/>[analisi_agar.py]"]
end

subgraph group_records["Results and learning"]
  node_history["Analysis history<br/>[storico_agar.py]"]
  node_sqlite[("Local history store<br/>[storico_agar.py]")]
  node_corrections["Correction dataset<br/>[storico_agar.py]"]
end

subgraph group_models["Model preparation"]
  node_dataset["AGAR dataset"]
  node_download_dataset["Dataset download<br/>[scarica_agar.py]"]
  node_conversion["YOLO conversion<br/>[converti_yolo.py]"]
  node_training["YOLO training<br/>[addestra_yolo.py]"]
end

subgraph group_organisms["Organism reference"]
  node_model_download["3D model download"]
  node_viewer3d["3D organism viewer<br/>[modelli3d_agar.py]"]
  node_organism_info["Organism profiles<br/>[lingue_agar.py]"]
end

node_user(("Plate analyst"))
node_sketchfab["Sketchfab"]

node_user -->|"loads plate"| node_desktop
node_desktop -->|"requests analysis"| node_analysis_engine
node_analysis_engine -->|"detects colonies"| node_yolo
node_analysis_engine -->|"segments contours"| node_sam
node_analysis_engine -->|"computes counts"| node_plate_metrics
node_desktop -->|"starts batch"| node_batch
node_batch -->|"exports summary"| node_csv
node_desktop -->|"exports results"| node_csv
node_desktop -->|"stores and reloads"| node_history
node_history -->|"reads and writes"| node_sqlite
node_desktop -->|"saves corrections"| node_corrections
node_history -->|"writes labels"| node_corrections
node_desktop -->|"uses interface text"| node_translations
node_desktop -->|"shows profiles"| node_organism_info
node_desktop -->|"opens viewer"| node_viewer3d
node_download_dataset -->|"downloads"| node_dataset
node_dataset -->|"provides annotations"| node_conversion
node_conversion -->|"prepares training data"| node_training
node_training -.->|"produces detector"| node_yolo
node_model_download -->|"downloads models"| node_sketchfab

click node_desktop "https://github.com/andreinacoding/dataset_agar/blob/main/app_agar.py"
click node_translations "https://github.com/andreinacoding/dataset_agar/blob/main/lingue_agar.py"
click node_analysis_engine "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_yolo "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_sam "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_plate_metrics "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_batch "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_csv "https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py"
click node_history "https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py"
click node_sqlite "https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py"
click node_corrections "https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py"
click node_download_dataset "https://github.com/andreinacoding/dataset_agar/blob/main/scarica_agar.py"
click node_conversion "https://github.com/andreinacoding/dataset_agar/blob/main/converti_yolo.py"
click node_training "https://github.com/andreinacoding/dataset_agar/blob/main/addestra_yolo.py"
click node_model_download "https://github.com/andreinacoding/dataset_agar/blob/main/scarica_modelli3d.py"
click node_viewer3d "https://github.com/andreinacoding/dataset_agar/blob/main/modelli3d_agar.py"
click node_organism_info "https://github.com/andreinacoding/dataset_agar/blob/main/lingue_agar.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_desktop,node_translations toneBlue
class node_analysis_engine,node_yolo,node_sam,node_plate_metrics,node_batch,node_csv toneAmber
class node_history,node_sqlite,node_corrections toneMint
class node_dataset,node_download_dataset,node_conversion,node_training toneRose
class node_model_download,node_viewer3d,node_organism_info,node_user,node_sketchfab toneIndigo
```

## Components

### Desktop analysis

- [AgarVision app](https://github.com/andreinacoding/dataset_agar/blob/main/app_agar.py): `app_agar.py`
- [Translations and facts](https://github.com/andreinacoding/dataset_agar/blob/main/lingue_agar.py): `lingue_agar.py`

### Image analysis

- [Plate analysis](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`
- [YOLO detector](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`
- [SAM2 contours](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`
- [Plate and CFU metrics](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`
- [Batch analysis](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`
- [CSV export](https://github.com/andreinacoding/dataset_agar/blob/main/analisi_agar.py): `analisi_agar.py`

### Results and learning

- [Analysis history](https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py): `storico_agar.py`
- [Local history store](https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py): `storico_agar.py`
- [Correction dataset](https://github.com/andreinacoding/dataset_agar/blob/main/storico_agar.py): `storico_agar.py`

### Model preparation

- **AGAR dataset**
- [Dataset download](https://github.com/andreinacoding/dataset_agar/blob/main/scarica_agar.py): `scarica_agar.py`
- [YOLO conversion](https://github.com/andreinacoding/dataset_agar/blob/main/converti_yolo.py): `converti_yolo.py`
- [YOLO training](https://github.com/andreinacoding/dataset_agar/blob/main/addestra_yolo.py): `addestra_yolo.py`

### Organism reference

- [3D model download](https://github.com/andreinacoding/dataset_agar/blob/main/scarica_modelli3d.py): `scarica_modelli3d.py`
- [3D organism viewer](https://github.com/andreinacoding/dataset_agar/blob/main/modelli3d_agar.py): `modelli3d_agar.py`
- [Organism profiles](https://github.com/andreinacoding/dataset_agar/blob/main/lingue_agar.py): `lingue_agar.py`

### Other components

- **Plate analyst**
- **Sketchfab**

## Connections

- Plate analyst → AgarVision app: loads plate (evidence: `README.md`)
- AgarVision app → Plate analysis: requests analysis (evidence: `README.md`)
- Plate analysis → YOLO detector: detects colonies (evidence: `analisi_agar.py`)
- Plate analysis → SAM2 contours: segments contours (evidence: `analisi_agar.py`)
- Plate analysis → Plate and CFU metrics: computes counts (evidence: `README.md`)
- AgarVision app → Batch analysis: starts batch (evidence: `README.md`)
- Batch analysis → CSV export: exports summary (evidence: `README.md`)
- AgarVision app → CSV export: exports results (evidence: `README.md`)
- AgarVision app → Analysis history: stores and reloads (evidence: `README.md`)
- Analysis history → Local history store: reads and writes (evidence: `storico_agar.py`)
- AgarVision app → Correction dataset: saves corrections (evidence: `README.md`)
- Analysis history → Correction dataset: writes labels (evidence: `storico_agar.py`)
- AgarVision app → Translations and facts: uses interface text (evidence: `app_agar.py`)
- AgarVision app → Organism profiles: shows profiles (evidence: `README.md`)
- AgarVision app → 3D organism viewer: opens viewer (evidence: `app_agar.py`)
- Dataset download → AGAR dataset: downloads (evidence: `scarica_agar.py`)
- AGAR dataset → YOLO conversion: provides annotations (evidence: `converti_yolo.py`)
- YOLO conversion → YOLO training: prepares training data (evidence: `addestra_yolo.py`)
- YOLO training → YOLO detector: produces detector
- 3D model download → Sketchfab: downloads models (evidence: `scarica_modelli3d.py`)
