Product Shot Editing
//
Segmentation
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
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.
POST
# 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())Segmentation masks successfully generated.
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" }