# PG-Pathformer

PG-Pathformer is a public semantic segmentation model by Pictograph Research on Pictograph, trained on the Sidewalks-1k dataset and exportable to ONNX for inference. Reported mIoU of 0.399.

## Overview

- Type: semantic segmentation model
- Task: Segmentation (https://pictograph.io/explore/task/segmentation)
- Architecture: Segformer
- Owner: Pictograph Research
- Trained on: Sidewalks-1k (https://pictograph.io/datasets/pictograph-research/sidewalks-1k)
- License: Creative Commons Attribution-NonCommercial 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
- Export: ONNX
- Stars: 1
- Page: https://pictograph.io/models/pictograph-research/pg-pathformer
- Hugging Face: https://huggingface.co/pictograph/pg-pathformer

## Evaluation metrics

- dice: 49.3%
- mIoU: 39.9%
- pixel_accuracy: 83.5%

## About

# PG-Pathformer

> A semantic segmentation model (Segformer), trained on 32 classes, scoring 39.9% mIoU.

**[Pictograph Research](/org/pictograph-research)** · Semantic Segmentation · Segformer · FP32 · [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/) · Public

## Overview

This is a semantic segmentation model built on **Segformer**, trained on the [Sidewalks-1k](/datasets/pictograph-research/sidewalks-1k) dataset. It expects **672x576** input and runs in FP32 precision. It predicts flat-road, flat-sidewalk, flat-crosswalk, flat-cyclinglane, flat-parkingdriveway, flat-curb, and 26 more.

## Performance

Headline: **39.9% mIoU**.

| Metric | Value |
| :--- | ---: |
| mIoU | 39.9% |
| Pixel accuracy | 83.5% |
| Dice | 49.3% |

### Per-class mIoU

| Class | mIoU |
| :--- | ---: |
| iou_background | 2.2% |
| iou_construction-bridge | 4.5% |
| iou_construction-building | 72.4% |
| iou_construction-door | 14.6% |
| iou_construction-fenceguardrail | 43.7% |
| iou_construction-stairs | 35.4% |
| iou_construction-wall | 41.5% |
| iou_flat-crosswalk | 63.9% |
| iou_flat-curb | 43.5% |
| iou_flat-cyclinglane | 67.4% |
| iou_flat-parkingdriveway | 42.3% |
| iou_flat-road | 73.2% |
| iou_flat-sidewalk | 86.5% |
| iou_human-person | 68.4% |
| iou_human-rider | 17.0% |
| iou_nature-terrain | 75.3% |
| iou_nature-vegetation | 82.0% |
| iou_object-pole | 35.0% |
| iou_object-trafficlight | 7.3% |
| iou_object-trafficsign | 32.5% |
| iou_sky | 94.1% |
| iou_vehicle-bicycle | 56.6% |
| iou_vehicle-bus | 0.0% |
| iou_vehicle-car | 83.6% |
| iou_vehicle-caravan | 0.0% |
| iou_vehicle-cartrailer | 0.0% |
| iou_vehicle-motorcycle | 0.0% |
| iou_vehicle-tramtrain | 0.0% |
| iou_vehicle-truck | 12.5% |
| iou_void-dynamic | 18.7% |

## Classes

Class index matches the model's output order.

| # | Class |
| ---: | :--- |
| 0 | flat-road |
| 1 | flat-sidewalk |
| 2 | flat-crosswalk |
| 3 | flat-cyclinglane |
| 4 | flat-parkingdriveway |
| 5 | flat-curb |
| 6 | human-person |
| 7 | human-rider |
| 8 | vehicle-car |
| 9 | vehicle-truck |
| 10 | vehicle-bus |
| 11 | vehicle-tramtrain |
| 12 | vehicle-motorcycle |
| 13 | vehicle-bicycle |
| 14 | vehicle-caravan |
| 15 | vehicle-cartrailer |
| 16 | construction-building |
| 17 | construction-door |
| 18 | construction-wall |
| 19 | construction-fenceguardrail |
| 20 | construction-bridge |
| 21 | construction-stairs |
| 22 | object-pole |
| 23 | object-trafficsign |
| 24 | object-trafficlight |
| 25 | nature-vegetation |
| 26 | nature-terrain |
| 27 | sky |
| 28 | void-ground |
| 29 | void-dynamic |
| 30 | void-static |
| 31 | void-unclear |

## Training

| Setting | Value |
| :--- | :--- |
| Base dataset | [Sidewalks-1k](/datasets/pictograph-research/sidewalks-1k) |
| Export | Sidewalks-1k-base |
| Dataset size | 1,000 images |
| Input size | 672x576 |
| Epochs | 35 |
| Batch size | 24 |
| Learning rate | 0.0001 |
| Precision | FP32 |
| Version | 1.0.0 |

## Use this model

Run inference with the Pictograph SDK:

```python
from pictograph import Client, get_model, SemanticSegmentationModel, SemanticSegmentationResult

client = Client(api_key="pk_live_...")  # Settings -> API Keys

# Downloads + caches the weights on first use
model: SemanticSegmentationModel = get_model(
    name="PG-Pathformer",
    task="semantic_segmentation",
    format="onnx",
    precision="fp32",
    device="cpu",
    client=client,
)
result: SemanticSegmentationResult = model.predict(image="photo.jpg")
print(result)
```

```python
# Fully offline (no API key) once you have the weights + config.json
from pictograph import load_model, SemanticSegmentationModel, SemanticSegmentationResult

model: SemanticSegmentationModel = load_model(
    "/path/to/weights.onnx",
    "/path/to/config.json",
    task="semantic_segmentation",
    format="onnx",
)
result: SemanticSegmentationResult = model.predict(image="photo.jpg")
```

- Full inference guide: [local inference docs](https://pictograph.io/docs/local-inference).
- REST + CLI: [models API reference](https://pictograph.io/docs/api-reference/models).
- Deploy it as an always-on endpoint: [deployments](https://pictograph.io/docs/deployments).

## License

Released under [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/).


---

Free to view, and to run in your browser on your own GPU (an image, a video or your camera; no sign-in): https://app.pictograph.io/explore/models/pictograph-research/pg-pathformer?run=1

Sign in (free) to fork this model, run batch inference, or deploy it as a live endpoint; this link opens it in the app afterwards: https://app.pictograph.io/signup?next=%2Fexplore%2Fmodels%2Fpictograph-research%2Fpg-pathformer
