Skip to main content
Use Perceptron Mk1.5 to describe an image for accessibility text, catalog metadata, search, or review. Specify the audience and desired detail in the prompt. A concise caption identifies the main subject; a detailed caption can describe its surroundings and relationships.

Choose the caption style

Install perceptron>=0.4.0 and set PERCEPTRON_API_KEY. This example sends the same public street image in two independent requests, one for each style.
The output wording will vary. Adjust the instruction rather than treating a style name as an API parameter: concise and detailed are labels in this example application.

Ground the caption in regions

Request boxes for the subjects mentioned in the description. Run this after the setup above:
An illustrative grounded phrase looks like:
This is a format illustration, not measured output for the sample image. A mention describes the cited region. Boxes use two normalized 0–1000 coordinates: top-left, then bottom-right. Convert using the dimensions of the asset selected by asset_idx; do not treat the numbers as source pixels. Use the shared rendering guide to turn response.txt into an overlay. The annotation reference also covers points, polygons, and collections. For captions comparing several images, request explicit selectors and follow multiple-asset ordering.

Write captions for their destination

For metadata that must be parsed, define a JSON Schema with structured outputs. Asking for JSON in a caption prompt alone does not enforce a schema. Use image Q&A when you need an answer to a specific question rather than an overall description.