﻿# OneFormer task inputs: semantic and instance requests change the model call

Preserve OneFormer task conditioning and metadata when switching semantic, instance or panoptic segmentation instead of changing only the output parser.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-oneformer-task-conditioning-input/
Language: en

## Treat task selection as conditioning

OneFormer uses a task-conditioned formulation for universal image segmentation. The [original paper](https://arxiv.org/abs/2211.06220) studies one model across semantic, instance and panoptic tasks. That unification does not mean an application can always obtain equivalent results by changing only the final visualization. Identify how the selected task enters the model request before comparing outputs that describe class regions, separate object instances or their combined panoptic interpretation.

## Preserve the processor's task input

The [Transformers documentation](https://huggingface.co/docs/transformers/model_doc/oneformer) exposes task inputs through its processor interface. Store the selected task alongside the image, checkpoint and processing configuration. A default selected by a wrapper can otherwise disappear from the experiment record. When adapting an existing script to another segmentation task, inspect the prepared model inputs instead of assuming that renaming an application route or output file changed the conditioning supplied to the network.

## Match the label metadata

The [official implementation](https://github.com/SHI-Labs/OneFormer) contains dataset and task configurations used by the project. Category names, thing-versus-stuff distinctions and model metadata belong to the chosen label space. A processor assembled from unrelated metadata can produce plausible labels with incorrect category interpretation. Keep the checkpoint and its associated metadata together when packaging an inference service, and check a small example that contains both countable objects and a broad background region.

## Compare tasks without collapsing their units

Semantic evaluation measures category assignments over pixels, while instance evaluation distinguishes separate objects. Panoptic output combines related but different requirements. A change in the number of reported regions therefore need not indicate a regression when the requested task changed. State the evaluation unit and postprocessing procedure explicitly. A user interface can present these outputs with similar colors even though their identifiers, counting rules and acceptable errors differ.

## Test the task switch end to end

Run the same image through deliberately selected task modes, preserving the actual task input and the corresponding output interpretation. Verify that changing the mode reaches the processor and model rather than only the display layer. Related guides to [scene-label hierarchies](/journal/data-guide-ade20k-scene-label-hierarchy/) and [annotation identities](/journal/data-guide-coco-instance-caption-identities/) provide context. OneFormer's specific boundary is the task-conditioned request: a shared checkpoint does not erase the distinction between what was asked and how its result should be evaluated.
