Intermittent Class Overwrite on COCO 1.0 Export when using Slicing/Split Tool
Actions before raising this issue
- I searched the existing issues and did not find anything similar.
- I read/searched the docs
Steps to Reproduce
- Draw a primary outer polygon (e.g., a circle).
- Use the Slicing / Split Tool to divide the polygon into two halves.
- Assign Class A to the upper half and Class B to the lower half in the UI.
- Save the annotations and export the dataset in COCO 1.0 format.
- Inspect
instances_default.jsonand compare thecategory_idvalues for both split shapes.
Expected Behavior
The exported COCO 1.0 JSON should contain two separate annotation objects with distinct category_id values corresponding to Class A and Class B.
Possible Solution
Possible Solution / Technical Insights
Frontend Canvas State Decoupling: When the Slicing/Split tool divides a polygon, the secondary slice appears to retain a state reference or object lineage to the parent polygon in the UI state store. Changing the label on the new slice in the sidebar may fail to update the underlying
label_idstate before a save event occurs.API Event Race Condition: When a user splits a shape and immediately updates the label, two API requests are fired: a
POSTto register the new split shapes, and aPATCHto update the new shape's category. If thePATCHrequest evaluates before the backend fully index-registers the new shape, the label update is silently ignored, leaving the shape with its parent's original category ID.Datumaro Lineage Fallback: If the UI state and API are correct, the bug may reside in Datumaro (CVAT's export engine). During COCO 1.0 JSON generation, Datumaro might be inspecting parent-child lineage metadata instead of strictly evaluating each polygon's active
label_id.
Context
In high-volume segmentation tasks (such as dividing structural objects, circles, or complex boundaries into sub-categories), annotators rely heavily on the Slicing tool to save time over re-drawing outer boundaries.
Because the UI visually updates and displays the new classes properly, annotators and QA reviewers have no visual indication that the annotations are corrupted. The issue is only discovered downstream during dataset conversion, mask mapping, or model training. Having to delete and manually re-draw split polygons from scratch eliminates the efficiency gains of the Slicing tool and risks silent data degradation in exported datasets.
Steps to Reproduce
- Draw a single outer polygon shape (e.g., a circle).
- Select the Slicing / Split Tool and cut the polygon into two separate halves.
- Assign Class A to the upper half and Class B to the lower half using the UI sidebar or shortcut.
- Save the annotations (
Ctrl + S) and export the dataset using the COCO 1.0 format (instances_default.json). - Parse the exported JSON file and inspect the
category_idattribute for both polygon entries.
Environment
* **CVAT Version:** [ cvat.ai Cloud ]
* **OS / Browser:** [ Windows 11 / Chrome]
* **Export Format:** COCO 1.0 (`instances_default.json`)Source: cvat-ai/cvat