Skip to content

Segmentation

Request

Description Generates segmentation masks for specific vehicle parts from an input image, enabling further enhancements such as reflection generation or wheel refinement.

This endpoint returns separate binary masks for each segmented region, including windows, wheels, and body parts. If a specific part is not detected in the image, it will be returned with an empty URL.

The API supports input via image URL or base64-encoded image file, and also includes optional content moderation.

Security
api_token
Bodyapplication/json
image_urlstring

The URL of the image containing the vehicle to segment. If both image_url and file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Max file size 12MB.

filestring

Base64-encoded image containing the vehicle to segment. Used only if image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Max file size 12MB.

POST
/product/vehicle/segment
# The Python SDK covers v2 endpoints; call this v1 endpoint over HTTP.
import os

import httpx

response = httpx.post(
    "https://engine.prod.bria-api.com/v1/product/vehicle/segment",
    headers={"api_token": os.environ["BRIA_API_TOKEN"]},
    json={
        "image_url": "https://example.com/car.jpeg",
    },
    timeout=120,
)
response.raise_for_status()
print(response.json())

Responses

Segmentation masks successfully generated.

Bodyapplication/json
windshieldstring

URL to the PNG mask of the windshield. Empty string if not detected.

rear_windowstring

URL to the PNG mask of the rear window. Empty string if not detected.

side_windowsstring

URL to the PNG mask of the side windows. Empty string if not detected.

bodystring

URL to the PNG mask of the vehicle body. Empty string if not detected.

wheelsstring

URL to the PNG mask of all visible wheels. Empty string if not detected.

hubcapstring

URL to the PNG mask of all visible hubcaps. Empty string if not detected.

tiresstring

URL to the PNG mask of all visible hubcaps. Empty string if not detected.

Response
{ "windshield": "https://example.com/masks/windshield.png", "rear_window": "", "side_windows": "https://example.com/masks/side_windows.png", "body": "https://example.com/masks/body.png", "wheels": "https://example.com/masks/wheels.png", "hubcap": "https://example.com/masks/hubcap.png", "tires": "https://example.com/masks/tires.png" }