# yuanqianguang/myceliumseg-benchmark architecture

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

- Interactive diagram: https://gitdiagram.com/yuanqianguang/myceliumseg-benchmark
- Repository: https://github.com/yuanqianguang/myceliumseg-benchmark

## Overview

MMSegmentation is a semantic-segmentation framework, with a repository-specific mycelium dataset and SegFormer configuration/model alongside the broader model zoo. Its visible inference workflow loads a configured segmentor, prepares an image through the test pipeline, runs the model, and returns a segmentation result; evaluation provides segmentation metrics. The README is empty, and several core modules are indexed but unsampled, so the graph limits call relationships to those shown in excerpts or the source index.

Main entry points: [`mmseg/apis/inference.py`](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/apis/inference.py) (Inference API), [`mmseg/datasets/custom.py`](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/custom.py) (Custom dataset base), [`mmseg/datasets/builder.py`](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/builder.py) (Dataset builder), [`mmseg/models/builder.py`](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/builder.py) (Model builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_pipeline["Pipeline composition<br/>[compose.py]"]
  node_transforms["Image transforms<br/>[transforms.py]"]
  node_loading["Pipeline loading<br/>[loading.py]"]
  node_formatting["Batch formatting<br/>[formating.py]"]
  node_dataset_builder["Dataset builder<br/>[builder.py]"]
  node_dataset_custom["Custom dataset base<br/>[custom.py]"]
  node_dataset_wrappers["Dataset wrappers"]
  node_pascal["Pascal Context<br/>[pascal_context.py]"]
end

subgraph group_models["Segmentation models"]
  node_model_builder["Model builder<br/>[builder.py]"]
  node_backbone["ResNet backbone<br/>[resnet.py]"]
  node_model_utils["Model utilities"]
  node_decode_head["Point decode head<br/>[point_head.py]"]
  node_loss["Lovasz loss<br/>[lovasz_loss.py]"]
end

subgraph group_results["Inference and evaluation"]
  node_inference["Inference API<br/>[inference.py]"]
  node_evaluation["Segmentation metrics<br/>[metrics.py]"]
  node_extra_metrics["Boundary metrics<br/>[extra_metrics.py]"]
end

subgraph group_custom["Mycelium specialization"]
  node_mycelium_dataset["EPA dataset<br/>[EPA_mycelium.py]"]
  node_mycelium_model["Mycelium SegFormer config"]
end

node_user(("User"))
node_image["Input image"]
node_segmentation["Segmentation result"]

node_user -->|"requests inference"| node_inference
node_image -->|"supplies image"| node_inference
node_inference -->|"composes pipeline"| node_pipeline
node_inference -->|"builds segmentor"| node_model_builder
node_inference -->|"returns result"| node_segmentation
node_dataset_builder -->|"builds wrappers"| node_dataset_wrappers
node_pascal -->|"extends base"| node_dataset_custom
node_dataset_custom -->|"uses registry"| node_dataset_builder
node_dataset_custom -->|"uses pipelines"| node_pipeline
node_transforms -->|"registers transforms"| node_dataset_builder
node_backbone -->|"registers backbone"| node_model_builder
node_model_builder -.->|"builds backbone"| node_backbone
node_evaluation -->|"imports metrics"| node_extra_metrics

click node_inference "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/apis/inference.py"
click node_pipeline "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/compose.py"
click node_transforms "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/transforms.py"
click node_loading "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/loading.py"
click node_formatting "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/formating.py"
click node_dataset_builder "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/builder.py"
click node_dataset_custom "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/custom.py"
click node_dataset_wrappers "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/dataset_wrappers.py"
click node_pascal "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pascal_context.py"
click node_model_builder "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/builder.py"
click node_backbone "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/backbones/resnet.py"
click node_model_utils "https://github.com/yuanqianguang/myceliumseg-benchmark/tree/main/mmseg/models/utils"
click node_decode_head "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/decode_heads/point_head.py"
click node_loss "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/losses/lovasz_loss.py"
click node_evaluation "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/core/evaluation/metrics.py"
click node_extra_metrics "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/core/evaluation/extra_metrics.py"
click node_mycelium_dataset "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mycelium_model/dataset/EPA_mycelium.py"
click node_mycelium_model "https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mycelium_model/model/segformer.b0.1024x1024.mycelium.507.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_pipeline,node_transforms,node_loading,node_formatting,node_dataset_builder,node_dataset_custom,node_dataset_wrappers,node_pascal,node_user toneBlue
class node_model_builder,node_backbone,node_model_utils,node_decode_head,node_loss toneAmber
class node_inference,node_evaluation,node_extra_metrics toneMint
class node_mycelium_dataset,node_mycelium_model toneRose
class node_image,node_segmentation toneIndigo
```

## Components

### Data preparation

- [Pipeline composition](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/compose.py): `mmseg/datasets/pipelines/compose.py`
- [Image transforms](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/transforms.py): `mmseg/datasets/pipelines/transforms.py`
- [Pipeline loading](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/loading.py): `mmseg/datasets/pipelines/loading.py`
- [Batch formatting](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pipelines/formating.py): `mmseg/datasets/pipelines/formating.py`
- [Dataset builder](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/builder.py): `mmseg/datasets/builder.py`
- [Custom dataset base](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/custom.py): `mmseg/datasets/custom.py`
- [Dataset wrappers](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/dataset_wrappers.py): `mmseg/datasets/dataset_wrappers.py`
- [Pascal Context](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/datasets/pascal_context.py): `mmseg/datasets/pascal_context.py`

### Segmentation models

- [Model builder](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/builder.py): `mmseg/models/builder.py`
- [ResNet backbone](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/backbones/resnet.py): `mmseg/models/backbones/resnet.py`
- [Model utilities](https://github.com/yuanqianguang/myceliumseg-benchmark/tree/main/mmseg/models/utils): `mmseg/models/utils`
- [Point decode head](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/decode_heads/point_head.py): `mmseg/models/decode_heads/point_head.py`
- [Lovasz loss](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/models/losses/lovasz_loss.py): `mmseg/models/losses/lovasz_loss.py`

### Inference and evaluation

- [Inference API](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/apis/inference.py): `mmseg/apis/inference.py`
- [Segmentation metrics](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/core/evaluation/metrics.py): `mmseg/core/evaluation/metrics.py`
- [Boundary metrics](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mmseg/core/evaluation/extra_metrics.py): `mmseg/core/evaluation/extra_metrics.py`

### Mycelium specialization

- [EPA dataset](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mycelium_model/dataset/EPA_mycelium.py): `mycelium_model/dataset/EPA_mycelium.py`
- [Mycelium SegFormer config](https://github.com/yuanqianguang/myceliumseg-benchmark/blob/main/mycelium_model/model/segformer.b0.1024x1024.mycelium.507.py): `mycelium_model/model/segformer.b0.1024x1024.mycelium.507.py`

### Other components

- **User**
- **Input image**
- **Segmentation result**

## Connections

- User → Inference API: requests inference (evidence: `mmseg/apis/inference.py`)
- Input image → Inference API: supplies image (evidence: `mmseg/apis/inference.py`)
- Inference API → Pipeline composition: composes pipeline (evidence: `mmseg/apis/inference.py`)
- Inference API → Model builder: builds segmentor (evidence: `mmseg/apis/inference.py`)
- Inference API → Segmentation result: returns result (evidence: `mmseg/apis/inference.py`)
- Dataset builder → Dataset wrappers: builds wrappers (evidence: `mmseg/datasets/builder.py`)
- Pascal Context → Custom dataset base: extends base (evidence: `mmseg/datasets/pascal_context.py`)
- Custom dataset base → Dataset builder: uses registry (evidence: `mmseg/datasets/custom.py`)
- Custom dataset base → Pipeline composition: uses pipelines (evidence: `mmseg/datasets/custom.py`)
- Image transforms → Dataset builder: registers transforms (evidence: `mmseg/datasets/pipelines/transforms.py`)
- ResNet backbone → Model builder: registers backbone (evidence: `mmseg/models/backbones/resnet.py`)
- Model builder → ResNet backbone: builds backbone (evidence: `mmseg/models/backbones/resnet.py`)
- Segmentation metrics → Boundary metrics: imports metrics (evidence: `mmseg/core/evaluation/metrics.py`)
