arch_instance_segmentation

Architectural Instance Segmentation

Segment architectural elements in a building image with a custom YOLOv8n segmentation checkpoint packaged for the AIOZ AI Node runtime.

MIT
Image Segmentation
PyTorch
English
by @AIOZAI
•
48
•
0

Last updated: 11 days ago


AIOZ AI Node Adapter Python

Architectural Instance Segmentation

Segment architectural elements in a building image with a custom YOLOv8n segmentation checkpoint packaged for the AIOZ AI Node runtime.

Summary

Introduction

This repository exposes the model through the same AIOZ entry-point convention as other AI Node packages: construct an InputObject, call my_ai_lib.run(input_obj), and receive an OutputObject. The workflow accepts one local image path or HTTP(S) image URL and returns a PNG with segmentation masks, class labels, confidence scores, and bounding boxes.

Model details

ItemValue
TaskInstance segmentation
ArchitectureYOLOv8n-seg
FrameworkUltralytics 8.3.233
Checkpointmodels/instance_segmentation/best.pt
Training image size640 px

The current checkpoint contains five classes:

IDClass
0window
1door
2column
3wall
4beam

Parameters

Input

  • input_image (image/string, required): Local path or HTTP(S) URL for a JPEG, PNG, WebP, or BMP image.
  • confidence_threshold (float, optional): Minimum prediction confidence in the inclusive range [0, 1]. Default: 0.25.
  • iou_threshold (float, optional): Non-maximum suppression IoU threshold in the inclusive range [0, 1]. Default: 0.70.
  • device (string, optional): cpu, cuda, or gpu. The default is cuda; execution falls back to CPU when CUDA is unavailable.
  • model_storage_directory (string, optional): Parent directory containing instance_segmentation. AIOZ supplies this value at runtime.

Output

  • output_image (image): An annotated PNG named architectural_segmentation.png, wrapped in an AIOZ FileObject.

Example

inputoutput

Usage for developers

Requirements

  • Python 3.10 or newer
  • Git LFS for the model checkpoint
  • CUDA-capable GPU is optional
git lfs pull
pip install -r requirements.txt

Run the demo

python demo.py path/to/sample.png --output architectural_segmentation.png

Use CPU explicitly or adjust the inference thresholds when needed:

python demo.py path/to/sample.png --device cpu --confidence-threshold 0.35 --iou-threshold 0.60

Use the AIOZ entry point

import my_ai_lib
from aioz_ainode_adapter.schemas import InputObject

input_obj = InputObject(
    input_image="path/to/building.jpg",
    confidence_threshold=0.25,
    iou_threshold=0.70,
    device="cuda",
    model_storage_directory="models",
)
output_obj = my_ai_lib.run(input_obj)

print(output_obj.output_image.name)

The public API is my_ai_lib.run(input_obj). Task-specific schemas and inference logic live in my_ai_lib/run.py as MyInput, MyOutput, do_ai_task, and run.

Project structure

.
├── aioz_ainode_adapter/
├── assets/
│   └── sample.png
├── models/
│   └── instance_segmentation/
│       ├── args.yaml
│       └── best.pt
├── my_ai_lib/
│   ├── __init__.py
│   └── run.py
├── demo.py
├── README.md
└── requirements.txt

Limitations

  • Accuracy can degrade on architectural styles, viewpoints, lighting conditions, or image quality that differ from the training data.
  • Small, occluded, or visually ambiguous elements may be missed or merged.
  • The confidence and IoU thresholds may need tuning for a particular deployment.
  • The repository does not include evaluation data or benchmark metrics, so no accuracy claim is made here.

References and attribution

  • Original model repository: TanTan2025/archivision-yolo, uploaded by Zilong Tan (TanTan2025).
  • The original model card attributes the model to the ArchiVision Team (2025).
  • Runtime and model architecture: Ultralytics YOLOv8.
  • Playground sample: A building facade by Maximden, dedicated to the public domain under CC0 1.0.

License

The original model card declared the repository as MIT licensed. The current best.pt checkpoint also embeds an Ultralytics AGPL-3.0 license notice. Both notices and the original attribution are preserved here; consult the Ultralytics licensing terms and confirm the model-specific terms with the original publisher before redistribution or production use.