Layers
What Are Layers in CVAT?
Layers are used to manage the display order of objects on the canvas. Each object is placed on a separate layer, and the layer’s position determines whether the object appears above or below other objects when they overlap.
The Layer Stack panel allows you to view and change the layer order. This is especially useful when working with overlapping polygons and masks, where you need to adjust the display order of objects without modifying the annotations themselves.
Layer Stack Panel
Description
The Layer Stack panel is displayed in the sidebar.
To open the panel, do one of the following:
- Click Open Layer Stack in the lower-right corner of the canvas.
- Select Sort by Layer in the sidebar.
After the panel opens, it displays a list of layers for the current frame.

Panel Interface
Description
The Layer Stack panel displays objects according to their actual order based on their assigned layers.

| Icon | Element name | Description |
|---|---|---|
| Open Layer Stack | Opens the Layer Stack panel and displays the number of the active layer. | |
| Compact layers | Renumbers layers starting from 0 while preserving their current order. This is useful when layer numbers become non-consecutive after objects are moved or deleted, for example, 0, 2, 5, 8. After running the command, the numbering becomes consecutive: 0, 1, 2, 3, and so on. | |
| Collapse/Expand All Layers | Collapses or expands object cards in the sidebar. When collapsed, only the layers remain visible, making the list more compact. | |
| Select as current layer | Hides objects located on layers above the selected layer. This allows you to focus on editing objects on the current layer and the layers below it. | |
| Layer number | Displays the layer number. | |
| Layer visibility status | Displays the current visibility status of the layer on the canvas. |
Working with Layers
Moving Objects Using Drag and Drop
Description
Allows you to change the position of an object or a group of objects in the layer order by dragging them in the Layer Stack panel. When moved, the object or group of objects is placed on a new layer created at the selected position.
Procedure
- Click and hold the left mouse button on an object or layer card in the Layer Stack panel.
- Drag the object or layer to the desired position in the list.
- Release the mouse button to change its position in the layer order.


You can also move an object to an existing layer.
Procedure
- Click and hold the left mouse button on an object card in the Layer Stack panel.
- Drag the object card into the desired layer.
- Release the mouse button. The object will be moved to the selected layer.

Merge Layers
Description
Using drag and drop, you can merge two layers by moving all objects from one layer to another.
Procedure
- Click and hold the left mouse button on a layer card in the Layer Stack panel.
- Drag the layer into another layer.
- Release the mouse button. All objects from the selected layer will be moved to the target layer, and the original layer will be deleted.

Move to Background / Foreground
#Description
Allows you to move an object to the bottommost layer (Move to Background) or the topmost layer (Move to Foreground). A new layer is automatically created for the object when the command is performed.
Procedure
- Click the ⋮ button on the object card.
- Select Move to Background or Move to Foreground.

Move to One Layer Backward / Forward
Description
Allows you to move the selected object one layer forward (Move to One Layer Forward) or one layer backward (Move to One Layer Backward) in the layer order.
Procedure
- Click the ⋮ button on the object card.
- Select Move to One Layer Backward or Move to One Layer Forward.

Move to Layer…
Description
Allows you to move an object to a specified layer.
Procedure
- Click the ⋮ button on the object card.
- Select Move to layer… from the menu.
- Enter the number of the layer to which you want to move the object.
- Click OK.

Compact Layers
Description
The Compact layers function removes gaps in layer numbering while preserving the current layer order. After the command is performed, the layers are renumbered consecutively starting from 0. For example, the sequence 0, 2, 5, 8 is converted to 0, 1, 2, 3.
When to Use It
Use Compact layers when gaps appear in the layer numbering, for example:
- After deleting layers.
- After merging layers.
- After moving objects or layers.
Procedure
- Open the Layer Stack panel.
- Click Compact layers.
- The layer numbering will be updated automatically.

Collapse/Expand Layers
Description
Allows you to collapse or expand object cards in the Layer Stack panel for all layers at once or for an individual layer.
When collapsed, only the layers are displayed in the list, while the cards of the objects they contain are hidden. This does not affect the visibility of objects on the canvas.

Displaying Layer Numbers on the Canvas
Description
Allows you to display the layer number in an object’s text description on the canvas. This helps you quickly identify the layer on which an object is located without opening the Layer Stack panel.

Enabling Layer Number Display
- Press F2 to open the settings, then go to the Workspace tab.
- Add the Layer parameter to the Content of a text field.
The layer number will then be displayed in the text description of each object on the canvas.
