Semantic Image Translation GAN API
Use structured scene layouts as meaningful controls, not just colorful pictures.
Treat the class map like a schema
Define the class vocabulary, encoding, dimensions, and any required instance or edge channels. A colored preview for people is not necessarily the machine-readable source of truth. Keep the mapping between class identifiers and meanings tied to the model revision.
The shared translation guide links to SPADE research as an example of layout-conditioned synthesis. Use that research to understand the input’s role without claiming that every semantic map or category arrangement is supported by a particular checkpoint.
Validate the spatial representation
Check unknown classes, invalid values, incomplete layouts, and misaligned channels before scheduling generation. Define categorical resizing behavior separately from photographic resizing. Do not allow an image-processing convenience to create nonexistent labels.
Record cropping, padding, orientation, and actual output dimensions. A layout-aligned workflow requires a consistent coordinate system across the request, generated image, and evaluator. Explicit failure is preferable to silently substituting an unsupported class.
Judge layout adherence and appearance
Inspect whether requested categories appear in the required regions and whether boundaries remain useful for the task. Evaluate appearance independently, and use a repeatable set of ordinary and difficult layouts. A plausible scene can still contradict its conditioning map.
When multiple samples are supported for one layout, present them as alternatives with their own configurations. Diversity is useful only when the alternatives continue to satisfy the same structural requirements. Keep a clear distinction between synthesized scenes and observed locations.
Vocabulary
Stable class definitions and valid encodings.
Coordinates
Aligned maps, channels, and output dimensions.
Adherence
Requested layout respected across samples.
Questions for this workflow
Can any colored image be used as a semantic map?
No. The map must use the model’s documented class representation. Validate values and alignment rather than inferring meaning from an arbitrary palette.
How is this different from style transfer?
A semantic layout explicitly supplies scene categories and their positions. Style transfer focuses on changing appearance under a separate content-preservation brief.
Image Translation and Semantic Layouts: Preserve What Matters
Compare image-to-image and layout-conditioned workflows, with explicit class maps, alignment rules, and preservation tests.
Read the complete guide