# zuyhung05/mobile_2026.1 architecture

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

- Interactive diagram: https://gitdiagram.com/zuyhung05/mobile_2026.1
- Repository: https://github.com/zuyhung05/mobile_2026.1

## Overview

InstructIR Android is an image-restoration engine library, with a demo app and Python tools for preparing its model assets and checking outputs. The main workflow is a consumer supplying a bitmap and restoration task; the engine loads the packaged model and task embedding, processes overlapping image patches through LiteRT, and returns a bitmap with backend and fallback information. The README identifies YOLO and a complete application as future work, not current capabilities. Some tool and demo relationships are based on README statements; unsampled implementation details are not inferred.

Main entry points: [`android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`](https://github.com/zuyhung05/mobile_2026.1/blob/main/android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java) (Restoration API), [`models/restoration`](https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration) (TFLite model), [`tools/restoration/compare_embeddings.py`](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare_embeddings.py) (Embedding comparison), [`models/restoration/embeddings`](https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration/embeddings) (Task embeddings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android restoration"]
  node_demo["Demo app<br/>[MainActivity.java]"]
  node_engine["Restoration API"]
  node_patch["Patch blending"]
end

subgraph group_assets["Model assets"]
  node_model[("TFLite model")]
  node_embeddings[("Task embeddings")]
end

subgraph group_tools["Preparation and evaluation"]
  node_export["Model export<br/>[export.py]"]
  node_baseline["Reference generation<br/>[baseline.py]"]
  node_compare["Output comparison<br/>[compare.py]"]
  node_compare_tiled["Tiled comparison<br/>[compare_tiled.py]"]
  node_compare_embeddings["Embedding comparison"]
end

node_consumer(("App consumer"))
node_litert["LiteRT runtime"]
node_instructir["InstructIR source"]

node_consumer -->|"submits image"| node_engine
node_demo -.->|"uses library"| node_engine
node_engine -->|"processes patches"| node_patch
node_engine -->|"maps model"| node_model
node_engine -->|"reads task vector"| node_embeddings
node_engine -->|"runs inference"| node_litert
node_export -->|"exports model"| node_instructir
node_export -->|"writes artifact"| node_model
node_baseline -->|"generates references"| node_instructir
node_baseline -->|"writes vectors"| node_embeddings
node_compare -->|"loads model"| node_model
node_compare -->|"runs inference"| node_litert
node_compare_tiled -->|"loads model"| node_model
node_compare_tiled -->|"runs inference"| node_litert
node_compare_embeddings -->|"loads model"| node_model
node_compare_embeddings -->|"reads vectors"| node_embeddings
node_compare_embeddings -->|"compares outputs"| node_instructir

click node_demo "https://github.com/zuyhung05/mobile_2026.1/blob/main/android/demo/app/src/main/java/vn/tv1/demo/MainActivity.java"
click node_engine "https://github.com/zuyhung05/mobile_2026.1/blob/main/android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java"
click node_patch "https://github.com/zuyhung05/mobile_2026.1/blob/main/android/restoration-engine/src/main/java/vn/tv1/restoration/PatchProcessor.java"
click node_model "https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration"
click node_embeddings "https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration/embeddings"
click node_export "https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/export.py"
click node_baseline "https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/baseline.py"
click node_compare "https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare.py"
click node_compare_tiled "https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare_tiled.py"
click node_compare_embeddings "https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare_embeddings.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_demo,node_engine,node_patch toneBlue
class node_model,node_embeddings toneAmber
class node_export,node_baseline,node_compare,node_compare_tiled,node_compare_embeddings toneMint
class node_consumer,node_litert,node_instructir toneIndigo
```

## Components

### Android restoration

- [Demo app](https://github.com/zuyhung05/mobile_2026.1/blob/main/android/demo/app/src/main/java/vn/tv1/demo/MainActivity.java): `android/demo/app/src/main/java/vn/tv1/demo/MainActivity.java`
- [Restoration API](https://github.com/zuyhung05/mobile_2026.1/blob/main/android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java): `android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`
- [Patch blending](https://github.com/zuyhung05/mobile_2026.1/blob/main/android/restoration-engine/src/main/java/vn/tv1/restoration/PatchProcessor.java): `android/restoration-engine/src/main/java/vn/tv1/restoration/PatchProcessor.java`

### Model assets

- [TFLite model](https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration): `models/restoration`
- [Task embeddings](https://github.com/zuyhung05/mobile_2026.1/tree/main/models/restoration/embeddings): `models/restoration/embeddings`

### Preparation and evaluation

- [Model export](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/export.py): `tools/restoration/export.py`
- [Reference generation](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/baseline.py): `tools/restoration/baseline.py`
- [Output comparison](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare.py): `tools/restoration/compare.py`
- [Tiled comparison](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare_tiled.py): `tools/restoration/compare_tiled.py`
- [Embedding comparison](https://github.com/zuyhung05/mobile_2026.1/blob/main/tools/restoration/compare_embeddings.py): `tools/restoration/compare_embeddings.py`

### Other components

- **App consumer**
- **LiteRT runtime**
- **InstructIR source**

## Connections

- App consumer → Restoration API: submits image (evidence: `README.md`)
- Demo app → Restoration API: uses library (evidence: `README.md`)
- Restoration API → Patch blending: processes patches (evidence: `android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`)
- Restoration API → TFLite model: maps model (evidence: `android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`)
- Restoration API → Task embeddings: reads task vector (evidence: `android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`)
- Restoration API → LiteRT runtime: runs inference (evidence: `android/restoration-engine/src/main/java/vn/tv1/restoration/RestorationEngine.java`)
- Model export → InstructIR source: exports model (evidence: `tools/restoration/export.py`)
- Model export → TFLite model: writes artifact (evidence: `README.md`)
- Reference generation → InstructIR source: generates references (evidence: `tools/restoration/baseline.py`)
- Reference generation → Task embeddings: writes vectors (evidence: `tools/restoration/baseline.py`)
- Output comparison → TFLite model: loads model (evidence: `tools/restoration/compare.py`)
- Output comparison → LiteRT runtime: runs inference (evidence: `tools/restoration/compare.py`)
- Tiled comparison → TFLite model: loads model (evidence: `tools/restoration/compare_tiled.py`)
- Tiled comparison → LiteRT runtime: runs inference (evidence: `tools/restoration/compare_tiled.py`)
- Embedding comparison → TFLite model: loads model (evidence: `tools/restoration/compare_embeddings.py`)
- Embedding comparison → Task embeddings: reads vectors (evidence: `tools/restoration/compare_embeddings.py`)
- Embedding comparison → InstructIR source: compares outputs (evidence: `tools/restoration/compare_embeddings.py`)
