# majidarif01/executor architecture

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

- Interactive diagram: https://gitdiagram.com/majidarif01/executor
- Repository: https://github.com/majidarif01/executor

## Overview

OmniParser turns screenshots into structured UI elements—detecting regions, describing icons, and extracting text—so a vision-based GUI agent can ground actions. Its companion episode runner selects screenshots from timelines, parses them, and writes annotated images and per-event JSON. The repository also contains accessibility-tree matching and keyboard-data ingestion/annotation workflows. Edges reflect explicit README statements or file references in the supplied source index; where implementation excerpts were unavailable, subsystem links are omitted rather than inferred.

Main entry points: [`omniparser/parse.py`](https://github.com/majidarif01/executor/blob/main/omniparser/parse.py) (Screenshot parser), [`Omniparser_Runner/runner.py`](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/runner.py) (Episode extraction), [`Accesibilitytree/accessibility_tree.py`](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/accessibility_tree.py) (Accessibility matcher), [`Data_parser/annotate_typing.py`](https://github.com/majidarif01/executor/blob/main/Data_parser/annotate_typing.py) (Typing screenshot annotation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screen_parser["Screen parsing"]
  node_parse_api["Screenshot parser<br/>[parse.py]"]
  node_detector["YOLO detector<br/>[yolov9.py]"]
  node_parse_utils["OCR and caption models<br/>[utils.py]"]
  node_box_annotator["Box annotation<br/>[box_annotator.py]"]
  node_semantic["Icon descriptions"]
  node_gradio["Interactive demo<br/>[gradio_demo.py]"]
  node_structured_elements["Structured UI elements"]
end

subgraph group_episode_runner["Episode annotation"]
  node_runner_cli["Runner CLI<br/>[cli.py]"]
  node_runner["Episode extraction<br/>[runner.py]"]
  node_timeline_reader["Timeline selection<br/>[timeline_reader.py]"]
  node_runner_models["Extracted event models<br/>[models.py]"]
  node_runner_config["Runner configuration<br/>[config.py]"]
  node_runner_outputs["Annotation outputs<br/>[outputs.py]"]
  node_annotated_results["Annotated images and JSON"]
end

subgraph group_accessibility["Accessibility matching"]
  node_accessibility_tree["Accessibility matcher"]
  node_find_element["Element finder<br/>[find_element.py]"]
  node_click_element["Click matching<br/>[ClickElement.py]"]
  node_typing_element["Typing matching<br/>[TypingElement.py]"]
  node_drag_finder["Drag hit testing"]
end

subgraph group_typing_data["Typing data workflows"]
  node_ingestion["Episode ingestion<br/>[data_ingestion.py]"]
  node_keyboard_data["Keyboard records<br/>[keyboard_data.py]"]
  node_typing_annotator["Typing screenshot annotation<br/>[annotate_typing.py]"]
  node_parse_outputs["Parse output writer<br/>[write_outputs.py]"]
  node_keyboard_annotations["Typing annotations"]
end

node_vision_agent(("GUI agent"))
node_screenshots["UI screenshots"]
node_episode_timeline["Episode timeline"]
node_accessibility_timeline["Timeline with accessibility data"]
node_episode_data["Recorded episode data"]

node_vision_agent -->|"uses results"| node_parse_api
node_screenshots -->|"parses"| node_parse_api
node_parse_api -->|"uses models"| node_parse_utils
node_parse_utils -->|"loads detector"| node_detector
node_parse_api -->|"returns elements"| node_structured_elements
node_parse_api -.->|"annotates regions"| node_box_annotator
node_parse_api -.->|"describes icons"| node_semantic
node_gradio -->|"runs parser"| node_parse_api
node_runner_cli -->|"starts extraction"| node_runner
node_runner_cli -->|"reads defaults"| node_runner_config
node_runner -->|"selects events"| node_timeline_reader
node_runner -->|"builds records"| node_runner_models
node_runner -->|"uses settings"| node_runner_config
node_runner -->|"parses screenshots"| node_parse_api
node_runner -->|"writes results"| node_runner_outputs
node_timeline_reader -->|"reads timeline"| node_episode_timeline
node_runner_outputs -->|"writes files"| node_annotated_results
node_accessibility_tree -->|"enriches events"| node_accessibility_timeline
node_accessibility_tree -->|"matches clicks"| node_click_element
node_accessibility_tree -->|"matches typing"| node_typing_element
node_accessibility_tree -->|"resolves drags"| node_drag_finder
node_accessibility_tree -->|"finds targets"| node_find_element
node_episode_data -->|"loads records"| node_ingestion
node_ingestion -->|"creates loader"| node_keyboard_data
node_typing_annotator -->|"loads typing records"| node_ingestion
node_typing_annotator -->|"parses screenshots"| node_parse_api
node_typing_annotator -->|"writes annotations"| node_parse_outputs
node_keyboard_data -->|"updates records"| node_keyboard_annotations
node_parse_outputs -->|"writes JSON"| node_keyboard_annotations

click node_parse_api "https://github.com/majidarif01/executor/blob/main/omniparser/parse.py"
click node_detector "https://github.com/majidarif01/executor/blob/main/omniparser/util/yolov9.py"
click node_parse_utils "https://github.com/majidarif01/executor/blob/main/omniparser/util/utils.py"
click node_box_annotator "https://github.com/majidarif01/executor/blob/main/omniparser/util/box_annotator.py"
click node_semantic "https://github.com/majidarif01/executor/blob/main/omniparser/semantic_meaning.py"
click node_gradio "https://github.com/majidarif01/executor/blob/main/omniparser/gradio_demo.py"
click node_runner_cli "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/cli.py"
click node_runner "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/runner.py"
click node_timeline_reader "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/timeline_reader.py"
click node_runner_models "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/models.py"
click node_runner_config "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/config.py"
click node_runner_outputs "https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/outputs.py"
click node_accessibility_tree "https://github.com/majidarif01/executor/blob/main/Accesibilitytree/accessibility_tree.py"
click node_find_element "https://github.com/majidarif01/executor/blob/main/Accesibilitytree/find_element.py"
click node_click_element "https://github.com/majidarif01/executor/blob/main/Accesibilitytree/ClickElement.py"
click node_typing_element "https://github.com/majidarif01/executor/blob/main/Accesibilitytree/TypingElement.py"
click node_drag_finder "https://github.com/majidarif01/executor/blob/main/Accesibilitytree/find_drag_elements.py"
click node_ingestion "https://github.com/majidarif01/executor/blob/main/Data_ingetion/data_ingestion.py"
click node_keyboard_data "https://github.com/majidarif01/executor/blob/main/Data_ingetion/keyboard_data.py"
click node_typing_annotator "https://github.com/majidarif01/executor/blob/main/Data_parser/annotate_typing.py"
click node_parse_outputs "https://github.com/majidarif01/executor/blob/main/Data_parser/write_outputs.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_parse_api,node_detector,node_parse_utils,node_box_annotator,node_semantic,node_gradio,node_structured_elements,node_vision_agent,node_screenshots toneBlue
class node_runner_cli,node_runner,node_timeline_reader,node_runner_models,node_runner_config,node_runner_outputs,node_annotated_results toneAmber
class node_accessibility_tree,node_find_element,node_click_element,node_typing_element,node_drag_finder toneMint
class node_ingestion,node_keyboard_data,node_typing_annotator,node_parse_outputs,node_keyboard_annotations toneRose
class node_episode_timeline,node_accessibility_timeline,node_episode_data toneIndigo
```

## Components

### Screen parsing

- [Screenshot parser](https://github.com/majidarif01/executor/blob/main/omniparser/parse.py): `omniparser/parse.py`
- [YOLO detector](https://github.com/majidarif01/executor/blob/main/omniparser/util/yolov9.py): `omniparser/util/yolov9.py`
- [OCR and caption models](https://github.com/majidarif01/executor/blob/main/omniparser/util/utils.py): `omniparser/util/utils.py`
- [Box annotation](https://github.com/majidarif01/executor/blob/main/omniparser/util/box_annotator.py): `omniparser/util/box_annotator.py`
- [Icon descriptions](https://github.com/majidarif01/executor/blob/main/omniparser/semantic_meaning.py): `omniparser/semantic_meaning.py`
- [Interactive demo](https://github.com/majidarif01/executor/blob/main/omniparser/gradio_demo.py): `omniparser/gradio_demo.py`
- **Structured UI elements**

### Episode annotation

- [Runner CLI](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/cli.py): `Omniparser_Runner/cli.py`
- [Episode extraction](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/runner.py): `Omniparser_Runner/runner.py`
- [Timeline selection](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/timeline_reader.py): `Omniparser_Runner/timeline_reader.py`
- [Extracted event models](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/models.py): `Omniparser_Runner/models.py`
- [Runner configuration](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/config.py): `Omniparser_Runner/config.py`
- [Annotation outputs](https://github.com/majidarif01/executor/blob/main/Omniparser_Runner/outputs.py): `Omniparser_Runner/outputs.py`
- **Annotated images and JSON**

### Accessibility matching

- [Accessibility matcher](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/accessibility_tree.py): `Accesibilitytree/accessibility_tree.py`
- [Element finder](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/find_element.py): `Accesibilitytree/find_element.py`
- [Click matching](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/ClickElement.py): `Accesibilitytree/ClickElement.py`
- [Typing matching](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/TypingElement.py): `Accesibilitytree/TypingElement.py`
- [Drag hit testing](https://github.com/majidarif01/executor/blob/main/Accesibilitytree/find_drag_elements.py): `Accesibilitytree/find_drag_elements.py`

### Typing data workflows

- [Episode ingestion](https://github.com/majidarif01/executor/blob/main/Data_ingetion/data_ingestion.py): `Data_ingetion/data_ingestion.py`
- [Keyboard records](https://github.com/majidarif01/executor/blob/main/Data_ingetion/keyboard_data.py): `Data_ingetion/keyboard_data.py`
- [Typing screenshot annotation](https://github.com/majidarif01/executor/blob/main/Data_parser/annotate_typing.py): `Data_parser/annotate_typing.py`
- [Parse output writer](https://github.com/majidarif01/executor/blob/main/Data_parser/write_outputs.py): `Data_parser/write_outputs.py`
- **Typing annotations**

### Other components

- **GUI agent**
- **UI screenshots**
- **Episode timeline**
- **Timeline with accessibility data**
- **Recorded episode data**

## Connections

- GUI agent → Screenshot parser: uses results (evidence: `README.md`)
- UI screenshots → Screenshot parser: parses (evidence: `README.md`)
- Screenshot parser → OCR and caption models: uses models (evidence: `omniparser/parse.py`)
- OCR and caption models → YOLO detector: loads detector (evidence: `omniparser/util/utils.py`)
- Screenshot parser → Structured UI elements: returns elements (evidence: `omniparser/parse.py`)
- Screenshot parser → Box annotation: annotates regions
- Screenshot parser → Icon descriptions: describes icons
- Interactive demo → Screenshot parser: runs parser (evidence: `omniparser/gradio_demo.py`)
- Runner CLI → Episode extraction: starts extraction (evidence: `Omniparser_Runner/cli.py`)
- Runner CLI → Runner configuration: reads defaults (evidence: `Omniparser_Runner/cli.py`)
- Episode extraction → Timeline selection: selects events (evidence: `Omniparser_Runner/runner.py`)
- Episode extraction → Extracted event models: builds records (evidence: `Omniparser_Runner/runner.py`)
- Episode extraction → Runner configuration: uses settings (evidence: `Omniparser_Runner/runner.py`)
- Episode extraction → Screenshot parser: parses screenshots (evidence: `Omniparser_Runner/runner.py`)
- Episode extraction → Annotation outputs: writes results (evidence: `Omniparser_Runner/runner.py`)
- Timeline selection → Episode timeline: reads timeline (evidence: `Omniparser_Runner/timeline_reader.py`)
- Annotation outputs → Annotated images and JSON: writes files (evidence: `Omniparser_Runner/outputs.py`)
- Accessibility matcher → Timeline with accessibility data: enriches events (evidence: `Accesibilitytree/accessibility_tree.py`)
- Accessibility matcher → Click matching: matches clicks (evidence: `Accesibilitytree/accessibility_tree.py`)
- Accessibility matcher → Typing matching: matches typing (evidence: `Accesibilitytree/accessibility_tree.py`)
- Accessibility matcher → Drag hit testing: resolves drags (evidence: `Accesibilitytree/accessibility_tree.py`)
- Accessibility matcher → Element finder: finds targets (evidence: `Accesibilitytree/accessibility_tree.py`)
- Recorded episode data → Episode ingestion: loads records (evidence: `Data_ingetion/data_ingestion.py`)
- Episode ingestion → Keyboard records: creates loader (evidence: `Data_ingetion/data_ingestion.py`)
- Typing screenshot annotation → Episode ingestion: loads typing records (evidence: `Data_parser/annotate_typing.py`)
- Typing screenshot annotation → Screenshot parser: parses screenshots (evidence: `Data_parser/annotate_typing.py`)
- Typing screenshot annotation → Parse output writer: writes annotations (evidence: `Data_parser/annotate_typing.py`)
- Keyboard records → Typing annotations: updates records (evidence: `Data_ingetion/keyboard_data.py`)
- Parse output writer → Typing annotations: writes JSON (evidence: `Data_parser/write_outputs.py`)
