# deepu1965/glance architecture

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

- Interactive diagram: https://gitdiagram.com/deepu1965/glance
- Repository: https://github.com/deepu1965/glance

## Overview

fashion-retrieval is a multimodal fashion-image search engine focused on binding attributes to specific garments. Its main user workflow is query parsing, lane selection and retrieval, rank fusion, optional vision verification, and result explanations. A separate indexing workflow prepares Fashionpedia images and region features for vector search; evaluation compares retrieval quality against baselines and ablations. Some subsystem implementations were not sampled, so those nodes use supported directory paths and unverified internal links are omitted.

Main entry points: [`src/fashion_retrieval/index/indexer.py`](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/indexer.py) (Index construction), [`src/fashion_retrieval/retrieve/pipeline.py`](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/pipeline.py) (Query pipeline), [`src/fashion_retrieval/cli.py`](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/cli.py) (CLI), [`src/fashion_retrieval/service.py`](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/service.py) (Service wiring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_cli["CLI<br/>[cli.py]"]
  node_service["Service wiring<br/>[service.py]"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_data["Dataset preparation"]
  node_dataset["Dataset loading<br/>[loader.py]"]
  node_regions["Region masks<br/>[mask_utils.py]"]
  node_color["Color extraction<br/>[color_extractor.py]"]
  node_attributes["Attribute tagging<br/>[attributor.py]"]
  node_scene["Scene tagging<br/>[scene_tagger.py]"]
end

subgraph group_indexing["Indexing and storage"]
  node_embedder["Image and text embeddings<br/>[embedder.py]"]
  node_fusion["Feature assembly<br/>[feature_fusion.py]"]
  node_indexer["Index construction<br/>[indexer.py]"]
  node_store["Vector store interface<br/>[store.py]"]
  node_qdrant[("Local Qdrant<br/>[qdrant_local.py]")]
end

subgraph group_retrieval["Query retrieval"]
  node_parser["Query parser<br/>[query_parser.py]"]
  node_router["Lane router<br/>[router.py]"]
  node_lanes["Retrieval lanes<br/>[lanes.py]"]
  node_rank_fusion["Rank fusion<br/>[fusion.py]"]
  node_pipeline["Query pipeline<br/>[pipeline.py]"]
  node_gate["Verification gate<br/>[verify_gate.py]"]
  node_verifier["Vision verifier<br/>[vlm_verifier.py]"]
  node_explain["Result explanations<br/>[explain.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluation["Evaluation and baselines"]
end

node_user(("Search user"))
node_fashionpedia[("Fashionpedia corpus")]
node_results["Ranked results"]

node_user -->|"submits query"| node_cli
node_cli -->|"builds components"| node_service
node_service -->|"loads settings"| node_config
node_fashionpedia -->|"provides images"| node_dataset
node_indexer -->|"loads data"| node_dataset
node_indexer -->|"uses masks"| node_regions
node_indexer -->|"extracts colors"| node_color
node_indexer -->|"tags attributes"| node_attributes
node_indexer -->|"tags scenes"| node_scene
node_indexer -->|"embeds features"| node_embedder
node_indexer -->|"assembles documents"| node_fusion
node_indexer -->|"writes documents"| node_store
node_qdrant -->|"implements"| node_store
node_cli -->|"builds index"| node_indexer
node_service -->|"configures backend"| node_qdrant
node_service -->|"wires pipeline"| node_pipeline
node_pipeline -->|"parses query"| node_parser
node_pipeline -->|"selects lanes"| node_router
node_pipeline -->|"runs retrieval"| node_lanes
node_pipeline -->|"fuses rankings"| node_rank_fusion
node_pipeline -->|"checks verification"| node_gate
node_pipeline -->|"builds explanations"| node_explain
node_gate -->|"requests verification"| node_verifier
node_pipeline -->|"returns results"| node_results
node_cli -->|"runs evaluation"| node_evaluation

click node_cli "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/cli.py"
click node_service "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/service.py"
click node_config "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/config.py"
click node_dataset "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/loader.py"
click node_regions "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/mask_utils.py"
click node_color "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/color_extractor.py"
click node_attributes "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/attributor.py"
click node_scene "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/scene_tagger.py"
click node_embedder "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/embedder.py"
click node_fusion "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/feature_fusion.py"
click node_indexer "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/indexer.py"
click node_store "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/store.py"
click node_qdrant "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/backends/qdrant_local.py"
click node_parser "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/query_parser.py"
click node_router "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/router.py"
click node_lanes "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/lanes.py"
click node_rank_fusion "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/fusion.py"
click node_pipeline "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/pipeline.py"
click node_gate "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/verify_gate.py"
click node_verifier "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/vlm_verifier.py"
click node_explain "https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/explain.py"
click node_evaluation "https://github.com/deepu1965/glance/tree/main/src/fashion_retrieval/eval"

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_cli,node_service,node_config,node_user toneBlue
class node_dataset,node_regions,node_color,node_attributes,node_scene,node_fashionpedia toneAmber
class node_embedder,node_fusion,node_indexer,node_store,node_qdrant toneMint
class node_parser,node_router,node_lanes,node_rank_fusion,node_pipeline,node_gate,node_verifier,node_explain toneRose
class node_evaluation,node_results toneIndigo
```

## Components

### Application entry

- [CLI](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/cli.py): `src/fashion_retrieval/cli.py`
- [Service wiring](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/service.py): `src/fashion_retrieval/service.py`
- [Configuration](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/config.py): `src/fashion_retrieval/config.py`

### Dataset preparation

- [Dataset loading](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/loader.py): `src/fashion_retrieval/dataset/loader.py`
- [Region masks](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/mask_utils.py): `src/fashion_retrieval/dataset/mask_utils.py`
- [Color extraction](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/color_extractor.py): `src/fashion_retrieval/models/color_extractor.py`
- [Attribute tagging](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/attributor.py): `src/fashion_retrieval/models/attributor.py`
- [Scene tagging](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/scene_tagger.py): `src/fashion_retrieval/models/scene_tagger.py`

### Indexing and storage

- [Image and text embeddings](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/embedder.py): `src/fashion_retrieval/models/embedder.py`
- [Feature assembly](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/dataset/feature_fusion.py): `src/fashion_retrieval/dataset/feature_fusion.py`
- [Index construction](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/indexer.py): `src/fashion_retrieval/index/indexer.py`
- [Vector store interface](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/store.py): `src/fashion_retrieval/index/store.py`
- [Local Qdrant](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/index/backends/qdrant_local.py): `src/fashion_retrieval/index/backends/qdrant_local.py`

### Query retrieval

- [Query parser](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/query_parser.py): `src/fashion_retrieval/models/query_parser.py`
- [Lane router](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/router.py): `src/fashion_retrieval/retrieve/router.py`
- [Retrieval lanes](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/lanes.py): `src/fashion_retrieval/retrieve/lanes.py`
- [Rank fusion](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/fusion.py): `src/fashion_retrieval/retrieve/fusion.py`
- [Query pipeline](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/pipeline.py): `src/fashion_retrieval/retrieve/pipeline.py`
- [Verification gate](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/verify_gate.py): `src/fashion_retrieval/retrieve/verify_gate.py`
- [Vision verifier](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/models/vlm_verifier.py): `src/fashion_retrieval/models/vlm_verifier.py`
- [Result explanations](https://github.com/deepu1965/glance/blob/main/src/fashion_retrieval/retrieve/explain.py): `src/fashion_retrieval/retrieve/explain.py`

### Evaluation

- [Evaluation and baselines](https://github.com/deepu1965/glance/tree/main/src/fashion_retrieval/eval): `src/fashion_retrieval/eval`

### Other components

- **Search user**
- **Fashionpedia corpus**
- **Ranked results**

## Connections

- Search user → CLI: submits query (evidence: `README.md`)
- CLI → Service wiring: builds components (evidence: `src/fashion_retrieval/cli.py`)
- Service wiring → Configuration: loads settings (evidence: `src/fashion_retrieval/service.py`)
- Fashionpedia corpus → Dataset loading: provides images (evidence: `README.md`)
- Index construction → Dataset loading: loads data (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Region masks: uses masks (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Color extraction: extracts colors (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Attribute tagging: tags attributes (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Scene tagging: tags scenes (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Image and text embeddings: embeds features (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Feature assembly: assembles documents (evidence: `src/fashion_retrieval/index/indexer.py`)
- Index construction → Vector store interface: writes documents (evidence: `src/fashion_retrieval/index/indexer.py`)
- Local Qdrant → Vector store interface: implements (evidence: `src/fashion_retrieval/index/backends/qdrant_local.py`)
- CLI → Index construction: builds index (evidence: `src/fashion_retrieval/cli.py`)
- Service wiring → Local Qdrant: configures backend (evidence: `src/fashion_retrieval/service.py`)
- Service wiring → Query pipeline: wires pipeline (evidence: `src/fashion_retrieval/service.py`)
- Query pipeline → Query parser: parses query (evidence: `README.md`)
- Query pipeline → Lane router: selects lanes (evidence: `README.md`)
- Query pipeline → Retrieval lanes: runs retrieval (evidence: `src/fashion_retrieval/retrieve/pipeline.py`)
- Query pipeline → Rank fusion: fuses rankings (evidence: `README.md`)
- Query pipeline → Verification gate: checks verification (evidence: `README.md`)
- Query pipeline → Result explanations: builds explanations (evidence: `src/fashion_retrieval/retrieve/pipeline.py`)
- Verification gate → Vision verifier: requests verification (evidence: `README.md`)
- Query pipeline → Ranked results: returns results (evidence: `src/fashion_retrieval/retrieve/pipeline.py`)
- CLI → Evaluation and baselines: runs evaluation (evidence: `src/fashion_retrieval/cli.py`)
