# b1t0nese/maclearn architecture

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

- Interactive diagram: https://gitdiagram.com/b1t0nese/maclearn
- Repository: https://github.com/b1t0nese/maclearn

## Overview

MacLearn is a desktop application for collecting internet images and preparing labeled image datasets. A user opens or creates a project in the Qt interface; the application manages project data and can run automated collection through Chrome and an image source. Collected images are processed and stored with project metadata, then prepared for export. The README also documents augmentation, annotation, dataset statistics, and logging. These capabilities are represented where their implementing modules are known; some finer relationships are not established by the sampled excerpts.

Main entry points: [`src/main.py`](https://github.com/b1t0nese/maclearn/blob/main/src/main.py) (Application controller), [`src/autodataset_module/autodataset.py`](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/autodataset.py) (Collection workflow), [`src/project_module/project_manager.py`](https://github.com/b1t0nese/maclearn/blob/main/src/project_module/project_manager.py) (Project storage), [`src/project_module/dataset_manager.py`](https://github.com/b1t0nese/maclearn/blob/main/src/project_module/dataset_manager.py) (Dataset preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_main["Application controller<br/>[main.py]"]
  node_ui["Project interface<br/>[window.py]"]
  node_embedded["Embedded program view"]
  node_logsui["Log window<br/>[logs_window.py]"]
end

subgraph group_collection["Image collection"]
  node_autodataset["Collection workflow<br/>[autodataset.py]"]
  node_browser["Chrome browser<br/>[browser.py]"]
  node_sourcebase["Image source registry<br/>[base.py]"]
  node_yandex["Yandex image search<br/>[yandex_images.py]"]
end

subgraph group_data["Project and dataset"]
  node_project[("Project storage<br/>[project_manager.py]")]
  node_dataset["Dataset preparation<br/>[dataset_manager.py]"]
end

subgraph group_support["Processing and support"]
  node_processing["Image processing<br/>[photoshop.py]"]
  node_utilities["Platform utilities<br/>[pcfuncs.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

node_user(("User"))
node_chrome(("Chrome"))

node_user -->|"opens project"| node_main
node_main -->|"controls interface"| node_ui
node_main -->|"opens project"| node_project
node_main -->|"manages dataset"| node_dataset
node_main -->|"starts collection"| node_autodataset
node_main -->|"shows logs"| node_logsui
node_main -->|"gets statistics"| node_project
node_ui -->|"uses view"| node_embedded
node_autodataset -->|"controls browser"| node_browser
node_autodataset -->|"creates source"| node_sourcebase
node_sourcebase -->|"uses browser"| node_browser
node_yandex -->|"implements source"| node_sourcebase
node_browser -->|"drives"| node_chrome
node_autodataset -->|"stores images"| node_project
node_autodataset -->|"processes images"| node_processing
node_dataset -->|"reads project data"| node_project
node_dataset -->|"uses processing"| node_processing
node_autodataset -->|"uses utilities"| node_utilities
node_autodataset -->|"logs activity"| node_logger
node_logger -->|"uses utilities"| node_utilities

click node_main "https://github.com/b1t0nese/maclearn/blob/main/src/main.py"
click node_ui "https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/window.py"
click node_embedded "https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/embedded_program_qt.py"
click node_logsui "https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/logs_window.py"
click node_autodataset "https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/autodataset.py"
click node_browser "https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/browser.py"
click node_sourcebase "https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/sources/base.py"
click node_yandex "https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/sources/yandex_images.py"
click node_project "https://github.com/b1t0nese/maclearn/blob/main/src/project_module/project_manager.py"
click node_dataset "https://github.com/b1t0nese/maclearn/blob/main/src/project_module/dataset_manager.py"
click node_processing "https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/photoshop.py"
click node_utilities "https://github.com/b1t0nese/maclearn/blob/main/src/pcfuncs.py"
click node_logger "https://github.com/b1t0nese/maclearn/blob/main/src/logger.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_main,node_ui,node_embedded,node_logsui,node_user toneBlue
class node_autodataset,node_browser,node_sourcebase,node_yandex toneAmber
class node_project,node_dataset toneMint
class node_processing,node_utilities,node_logger toneRose
class node_chrome toneIndigo
```

## Components

### Desktop application

- [Application controller](https://github.com/b1t0nese/maclearn/blob/main/src/main.py): `src/main.py`
- [Project interface](https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/window.py): `src/interface_module/window.py`
- [Embedded program view](https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/embedded_program_qt.py): `src/interface_module/embedded_program_qt.py`
- [Log window](https://github.com/b1t0nese/maclearn/blob/main/src/interface_module/logs_window.py): `src/interface_module/logs_window.py`

### Image collection

- [Collection workflow](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/autodataset.py): `src/autodataset_module/autodataset.py`
- [Chrome browser](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/browser.py): `src/autodataset_module/browser.py`
- [Image source registry](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/sources/base.py): `src/autodataset_module/sources/base.py`
- [Yandex image search](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/sources/yandex_images.py): `src/autodataset_module/sources/yandex_images.py`

### Project and dataset

- [Project storage](https://github.com/b1t0nese/maclearn/blob/main/src/project_module/project_manager.py): `src/project_module/project_manager.py`
- [Dataset preparation](https://github.com/b1t0nese/maclearn/blob/main/src/project_module/dataset_manager.py): `src/project_module/dataset_manager.py`

### Processing and support

- [Image processing](https://github.com/b1t0nese/maclearn/blob/main/src/autodataset_module/photoshop.py): `src/autodataset_module/photoshop.py`
- [Platform utilities](https://github.com/b1t0nese/maclearn/blob/main/src/pcfuncs.py): `src/pcfuncs.py`
- [Logging](https://github.com/b1t0nese/maclearn/blob/main/src/logger.py): `src/logger.py`

### Other components

- **User**
- **Chrome**

## Connections

- User → Application controller: opens project (evidence: `README.md`)
- Application controller → Project interface: controls interface (evidence: `src/main.py`)
- Application controller → Project storage: opens project (evidence: `src/main.py`)
- Application controller → Dataset preparation: manages dataset (evidence: `src/main.py`)
- Application controller → Collection workflow: starts collection (evidence: `src/main.py`)
- Application controller → Log window: shows logs (evidence: `src/main.py`)
- Application controller → Project storage: gets statistics (evidence: `src/main.py`)
- Project interface → Embedded program view: uses view (evidence: `src/interface_module/window.py`)
- Collection workflow → Chrome browser: controls browser (evidence: `src/autodataset_module/autodataset.py`)
- Collection workflow → Image source registry: creates source (evidence: `src/autodataset_module/autodataset.py`)
- Image source registry → Chrome browser: uses browser (evidence: `src/autodataset_module/sources/base.py`)
- Yandex image search → Image source registry: implements source (evidence: `src/autodataset_module/sources/yandex_images.py`)
- Chrome browser → Chrome: drives (evidence: `src/autodataset_module/browser.py`)
- Collection workflow → Project storage: stores images (evidence: `src/autodataset_module/autodataset.py`)
- Collection workflow → Image processing: processes images (evidence: `src/autodataset_module/autodataset.py`)
- Dataset preparation → Project storage: reads project data (evidence: `src/project_module/dataset_manager.py`)
- Dataset preparation → Image processing: uses processing (evidence: `src/project_module/dataset_manager.py`)
- Collection workflow → Platform utilities: uses utilities (evidence: `src/autodataset_module/autodataset.py`)
- Collection workflow → Logging: logs activity (evidence: `src/autodataset_module/autodataset.py`)
- Logging → Platform utilities: uses utilities (evidence: `src/logger.py`)
