The cml:boundingbox feature allows contributors to box objects of interest directly on an image for any use case. The output format of these annotations is a JSON array of the x,y coordinates of each labeled box. This tool can be used with our Graphical Editor or Code Editor as mentioned in the following article.
Fig. 1: Image with bounding box annotations
The CML used for the bounding box tool is illustrated by this example:
<cml:boundingbox name="annotation" url-header="image_url" default-width="100" default-height="100" min-width="10" min-height="10" max-width="1000" max-height="1000" threshold="0.85" allow-no-boxes="true" validates="required" gold="true"></cml:boundingbox>
The following section describes each attribute as seen above:
- This attribute will define the bounding box tool as the method by which you want contributor responses.
- This attribute will become the header of a column in your generated CSV containing the contributor responses. Alternatively, label may be used instead.
- Note: This attribute should not be changed. If changed, test question judgments will not be shown when monitoring a running job.
- To reference the column of your source data that contains the URL of the image to be annotated, use the url-header attribute. This field is a required field for all instances of the cml:boundingbox tool, but the value can be renamed to the actual column of the source image URL.
- To define the default pixel dimensions of the bounding boxes in the image annotation tool use default-width and default-height attribute. If your data has some kind of average or consistent size or orientation, configuring this to those needs may help contributors work more quickly.
- The default will be 100 pixels for each attribute
- To define the minimum dimensions of the bounding boxes in the image annotation tool use min-width and min-height attribute. This can be helpful to set if you are not interested in annotations of very small or distant objects.
- To define the maximum pixel dimensions of the bounding boxes in the image annotation tool use max-width and max-height attribute. This can be helpful to set if you know your images are unlikely to have very large or up-close objects.
- To define the threshold of 'overlap' in which contributors' responses will be matched against test questions, use the threshold attribute.
- Matching is performed on bounding boxes using intersection over union.
- To enable “No Boxes” button which when clicked allows contributors to submit judgments with no boxes. If not declared or set to false “No Boxes” button will not be displayed and all units will require 1 or more boxes to be submitted. All judgements submitted with “No Boxes” clicked will have no output column.
- NOTE: If you require a separate output column for the absence of boxes, you may set no-boxes-allowed=”false” and create two questions. The first, a checkbox asking if any objects to be boxed exist, and second a logic dependent bounding box that only displays if the checkbox is unchecked.This will provide you with an output column indicating if there are annotatable objects in the image you can use for other purposes.
- To define if this field is required use the validates attribute tag.
- To define the type and threshold of aggregation to use with this tool if you are collecting multiple judgements. Read more about bounding box aggregation.
- To enable test questions for image annotation use the gold attribute