# Image vector interface

{% hint style="info" %}
When [creating a dataset](https://sdkdocs.segments.ai/en/latest/client.html#create-a-dataset) through the Python SDK, choose `vector` or `image-vector-sequence` as the `task_type` to use this labeling interface.&#x20;
{% endhint %}

## Add a new object

To add a new object:

1. Select an annotation type (see [#annotation-types](#annotation-types "mention"))
2. Label the object by drawing on the image&#x20;

## Select an object

1. Press `Space` or `Escape` or click the ![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FuoX7vMGpEQ7B4tX06Ci6%2Fimage.png?alt=media\&token=32422415-bb86-4888-ae02-80237bfc189e) button in the left toolbar to enter view-and-select mode
2. Click on a labeled object to select it. You can also select an object by selecting it in the right sidebar

## Remove an object

Select an object and press `Backspace` to remove it. You can also click the ![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2F7fCyoWpxvV4IwFPXMpj2%2Fimage.png?alt=media\&token=6a783edd-17e3-422f-9ddf-90ca90064547) icon in the sidebar to remove an object.

## Change the category of an object

Select an object and click on its name in the sidebar to select a different category. You can also use hotkey `c` to change the category of the active object.

## Intersect bounding boxes / polygons

To make it easy to draw shapes closely together you can just draw overlapping bounding boxes and polygons. If you then select one of the overlapping shapes you can press the hotkey (default `r` ) to intersect the active shape with the other shapes it overlaps with.

## Annotation types

### Bounding box

Click the![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FTLCXhu5Da5KtjcPEOAT2%2Fimage.png?alt=media\&token=8a014cd6-0b36-497e-9b13-a2c9d88835c8)button in the left toolbar to draw a bounding box. Click and drag to draw the box.

### Polygon

Click the![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FpN7idnv88wnYXMB492sH%2Fimage.png?alt=media\&token=67e64484-476b-4855-a0b5-3e1d5e34ba6f)button in the left toolbar to draw a polygon. Click on the image to draw polygon points. Double click or click the first point of the polygon to finish it.

After finishing a polygon, you can add a point to it with `Shift + left click`. This will add a point to the edge closest of the cursor. You will see a preview of where the point will be added as soon as you press `Shift`. You can add points to a selected polygon in *view-and-select* mode, or while still in *draw polygon* mode after finishing it. \
You can remove a point by `Shift + left click`. A polygon needs at least 3 points.

When holding `Shift + F`node snapping is activated. This will snap the point you want to add to the nearest handle of an existing vector, within a certain distance threshold.

### Polyline

Click the![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FgHh8m3xkMAvwkmirQwej%2Fimage.png?alt=media\&token=3b2a051a-844b-422d-97c1-0a55b2b9c254)button in the left toolbar to draw a polyline. Click on the image to draw polyline points. Double click to finish it.

After finishing a polyline, you can add a point to it with `Shift + left click`. This will add a point to the edge closest of the cursor. You will see a preview of where the point will be added as soon as you press `Shift`. You can add points to a selected polyline in *view-and-select* mode, or while still in *draw polygon* mode after finishing it.\
You can remove a point by `Shift + left click`. A polyline needs at least 2 points.

When holding `Shift + F`node snapping is activated. This will snap the point you want to add to the nearest handle of an existing vector, within a certain distance threshold.

### Keypoint

Click the![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FbuUPAo7yQOT8O6NqhGlS%2Fimage.png?alt=media\&token=b401c38e-827e-495c-aceb-c1120f864e1c)button in the left toolbar to draw a keypoint.

## Ruler mode

1. Click the ![](https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2F7xU0plOK8FlmgAV6sdru%2Fimage.png?alt=media\&token=8b0d9986-ead7-4cd9-b382-5e1e0922d9ee)button in the right toolbar or press hotkey `z` to toggle the ruler mode
2. Click in the interface to set the first point
3. Move your cursor to another point and it will display the measurement in pixels
4. Click again to go back to select-and-view mode or press `esc`
