Parameters
RGB image as file path, URL, PIL Image, or numpy array.
Text prompt describing objects to segment. Exclusive with
points/boxes.List of
[x, y] point coordinates. Exclusive with text/boxes. Requires labels.List of
[x0, y0, x1, y1] box coordinates. Exclusive with text/points. Requires labels.Required for
points/boxes. 1 = foreground, 0 = background.Optional HTTP timeout.
Returns
np.ndarray — Binary segmentation mask of shape (H, W) with dtype uint8. Foreground 255, background 0.
Example Output
