Multi-object detection enables OpenSearch Vector Search Edition to identify and match multiple objects in a single image—such as people, products, and scenes—during an image search. Instead of matching on the single dominant object, the search engine analyzes all prominent objects in the query image and returns results based on any of them.
For example, an image of a cyclist contains several detectable objects: a helmet, riding clothes, a bicycle, and gloves. With multi-object detection enabled, the search engine evaluates all of these objects and surfaces results relevant to any combination of them, improving recall and relevance in complex visual search scenarios.
How it works
When a user submits an image query, the search engine detects all prominent objects in the image. You control this behavior with two parameters:
| Parameter | Description |
|---|---|
crop |
Specifies whether to run object detection on the uploaded image during a search. |
range |
Specifies the area of the image to scan for objects. Use this to focus detection on a specific region rather than the entire image. |
The `range` parameter
The range value uses the format x1,y1,x2,y2, where:
x1,y1— the x and y coordinates of the upper-left corner of the detection areax2,y2— the width and height of the detection area
Use range when you want to limit detection to a particular region—for example, to focus on a product in the foreground rather than the background scene. If you omit range, the search engine runs the search based on the largest detected object.
The detection results are included in the search response.
Prerequisites
Before you begin, make sure you have:
An OpenSearch Vector Search Edition instance
An instance configured for image search
For setup instructions, see the "Preparations", "Purchase an OpenSearch Vector Search Edition instance", and "Configure an instance" sections of Build an end-to-end image search solution.
Test multi-object detection in the console
On the details page of your instance, click the Query Test tab.
Select the table to use for search tests.
Set Query Type to Image.
Set Method for Providing Images to Upload Image File.
Set Multiple-subject Recognition to Enable.
Upload an image and run the search.
View the detection results in the Search Results section.
Query syntax
For the query syntax used with multi-object detection:
Use the SDK
To use multi-object detection programmatically with OpenSearch Vector Search Edition SDKs:
Query data — detect objects and query by primary key
Update data — upload, update, and delete documents