Skip to content

Pipelines

Gaurav14cs17 edited this page Jun 21, 2026 · 1 revision

Pipelines

FlashFusion provides pre-built multi-task pipelines that combine detection, classification, and segmentation models.

Available Pipelines

Pipeline Description
DetClsPipeline Detection + Classification
DetSegPipeline Detection + Segmentation
MultiTaskPipeline Detection + Classification + Segmentation

Detection + Classification Pipeline

Combines a detector with a classifier for fine-grained recognition:

from flashfusion.pipelines import DetClsPipeline

pipeline = DetClsPipeline(
    det_model="flashdet_m.pt",
    cls_model="flashcls_m.pt",
    device="cuda",
)

results = pipeline.run("image.jpg")
# Returns: detections with refined class labels

Detection + Segmentation Pipeline

Combines a detector with a segmentation model:

from flashfusion.pipelines import DetSegPipeline

pipeline = DetSegPipeline(
    det_model="flashdet_m.pt",
    seg_model="flashseg_m.pt",
    device="cuda",
)

results = pipeline.run("image.jpg")
# Returns: detections + per-pixel segmentation masks

Multi-Task Pipeline

Full multi-task fusion combining all model types:

from flashfusion.pipelines import MultiTaskPipeline

pipeline = MultiTaskPipeline(
    models={
        "detection": "flashdet_m.pt",
        "classification": "flashcls_m.pt",
        "segmentation": "flashseg_m.pt",
    },
    strategy="wbf",
    device="cuda",
)

results = pipeline.run("image.jpg")

Configuration-Based Pipelines

Use YAML configs to define pipelines:

flashfusion predict --config configs/flashfusion_det_cls_320.yaml --source image.jpg
flashfusion predict --config configs/flashfusion_det_seg_320.yaml --source image.jpg

Custom Pipelines

Register custom pipelines via the registry:

from flashfusion.registry import PIPELINES

@PIPELINES.register("my_pipeline")
class MyPipeline:
    def __init__(self, **kwargs):
        ...

    def run(self, source):
        ...

Clone this wiki locally