- 1. File Management
- 2. Editing
- 3. View
- 4. Annotation Import and Export
- 5. Toolbar
- 6. Help and Language
- 7. User Configuration
- 8. Tasks
- 9. Models
This section details how to import, manage, and save data using X-AnyLabeling. Users can import images and video files in various ways, including shortcuts or menu options. Additionally, it covers data deletion, image switching, and saving of labels and image data to ensure an efficient annotation process and secure data management.
After opening the GUI, users can select the corresponding task type for import from the File
dropdown menu at the top of the interface or use shortcuts.
X-AnyLabeling currently supports three data import formats:
- Image File Directory (Ctrl+U): Supports importing multiple files with multi-level directory nesting.
- Single Image File (Ctrl+I): Supports importing various formats such as
*.jpg
,*.png
,*.bmp
,*.webp
, and*.tif
. - Single Video File (Ctrl+O): Supports importing video formats such as
*.mp4
,*.avi
,*.mov
,*.mkv
,*.wmv
, and*.flv
.
X-AnyLabeling provides data deletion functionalities as follows:
- Delete Label File (Ctrl+Delete): Deletes the current annotation file. This operation cannot be undone, so please proceed with caution.
- Delete Image File (Ctrl+Shift+Delete): Deletes the current image file, moving it to the
_delete_
folder within the current image directory.
In X-AnyLabeling, in addition to regular image switching operations, the following methods are also supported:
Shortcut | switch_to_checked | Description |
---|---|---|
Ctrl+Shift+A | true | Jump to the previous annotated image |
Ctrl+Shift+D | true | Jump to the next annotated image |
Ctrl+Shift+A | false | Jump to the previous unannotated image |
Ctrl+Shift+D | false | Jump to the next unannotated image |
You can determine the switching mode by modifying the switch_to_checked
field in the user configuration file.
Additionally, you can jump to a specific image by entering the image name in the file search bar at the bottom right of the interface and pressing Enter.
X-AnyLabeling has an auto-save feature enabled by default. Upon initial startup, users can check if the Auto Save
option is selected from the File
dropdown menu.
Label files are saved in the current image directory in *.json
format, with the following template:
{
"version": "${version}",
"flags": {},
"shapes": [
{
"label": "${label}",
"score": null,
"points": [...],
"group_id": null,
"description": null,
"difficult": false,
"shape_type": "${shape_type}",
"flags": null,
"attributes": {}
}
],
"imagePath": "${filename}",
"imageData": null, // base64
"imageHeight": -1,
"imageWidth": -1
}
Change Output Directory
option from the File
dropdown menu and set the desired save path.
If you want to save the current image data (default base64
encoded) during annotation, you can enable the Save Image Data
option from the File
dropdown menu.
This section guides you on creating, editing, and managing various types of annotation objects and their label information in X-AnyLabeling. It covers everything from basic operations to advanced features, ensuring comprehensive guidance.
In X-AnyLabeling, each distinct annotated object is referred to as a shape
, with key properties such as:
Field | Type | Description |
---|---|---|
label |
String | The category label of the object. |
score |
Float | The confidence score of the object, typically used in AI inference. If unavailable, it is null . |
points |
Array | List of vertices' coordinates, depending on the shape_type . |
group_id |
Integer | Group ID to associate multiple objects within the same group; null if not available. |
description |
String | Description of the object; null if not available. |
difficult |
Boolean | Indicates if the object is difficult to identify; true means difficult. |
shape_type |
String | The shape type, such as "rectangle" , "polygon" , etc. |
flags |
Dictionary | Additional flag information for extra state or attributes; null if not available. |
attributes |
Dictionary | Object's attribute information; an empty dictionary {} if not available. |
kie_linking |
List | Connection information between objects, e.g., [[1,2],[3,4]] ; an empty list [] if not available. |
For more details on additional fields, refer to shape.py.
X-AnyLabeling supports creating the following types of shape objects:
- Rectangle (R): Start drawing by left-clicking, move the cursor, and click again to finish the rectangle.
- Rotation (O): Start drawing by left-clicking, move the cursor, and click again to finish the rotated box.
- Polygon (P): Start drawing by left-clicking along the object's edge, adding segmentation points. Click on the starting point to finish. A minimum of 3 points is required.
- Point: Left-click to create a key point.
- Line: Start drawing by left-clicking, move the cursor, and click again to finish the line segment.
- Line Strip: Start drawing by left-clicking, move the cursor, click to add line segments, and double-click to finish.
- Circle: Start drawing by left-clicking, move the cursor to define the radius, and click again to finish.
Users can operate through the corresponding options in the left menu, right-click, or use shortcuts.
X-AnyLabeling has two modes: Drawing Mode and Editing Mode.
- Drawing Mode: Users can create multiple objects continuously.
- Editing Mode: Users can edit objects (Ctrl+E), undo (Ctrl+Z), copy (Ctrl+C), paste (Ctrl+V), delete (Delete), move, scale, rotate, etc.
Users can quickly switch between drawing and editing modes using the Ctrl+J
shortcut or the corresponding options mentioned in section 2.1.
Specific operations include:
- For rectangular objects, besides resizing by corner points, users can select multiple objects and merge them into a bounding rectangle by right-clicking and selecting "Merge Selected Objects."
- For polygon objects, in editing mode, users can drag on an edge to add a new vertex or remove a selected vertex by holding the
Shift
key and left-clicking. - For rotation box objects, users can control the rotation angle and direction by selecting the target and using
Z
,X
,C
,V
. Real-time rotation angles can also be displayed.
When creating or editing an object, a label editing box pops up for editing the object's label information.
Field | Description |
---|---|
Object Label | Enter the object's category label, supporting fuzzy search. |
Group ID | For specific tasks like keypoint detection and multi-object tracking. |
Difficult Label | Indicates if the object is difficult to recognize. |
Label List | Shows the list of added labels, sorted alphabetically by default. |
Label Description | Additional flag information for extra states or attributes, `null` if not available. |
Label Linking | For linking fields in tasks like key information extraction and relationship extraction. |
Currently, X-AnyLabeling supports adding a Caption
description to the current image. To do this, enter editing mode, click on the blank area of the image, and fill in the image description in the Description
area on the right.
This section demonstrates how to optimize and customize the display of images and annotation objects in X-AnyLabeling, including visual adjustments of the canvas and images, as well as object information visualization settings, ensuring an efficient and intuitive annotation workflow.
X-AnyLabeling currently supports the following canvas operations:
- Zoom In (Ctrl++)
- Zoom Out (Ctrl+-)
- Reset (Ctrl+0)
Besides setting the zoom ratio in the left window and using shortcuts, users can also zoom in on specific areas by holding the Ctrl
key and using the mouse scroll wheel for precise annotation and small object labeling. To apply this change globally, ensure to select the Keep Previous Zoom Ratio
option from the View
dropdown menu.
X-AnyLabeling supports color adjustment for the current image. Operations include:
- Select
Brightness Contrast
from theView
dropdown menu at the top of the interface to adjust the brightness and contrast for better visual effects. - To apply this change globally, select
Keep Current Brightness
andKeep Current Contrast
from theView
dropdown menu.
Additionally, as the cursor moves, the information bar at the bottom of the GUI displays the current image's filename and annotation progress in real time.
Object visualization features include displaying text descriptions (Ctrl+T), label names (Ctrl+L), group IDs, rotation angles, and prediction scores of annotated objects in the current image. Users can set these through shortcuts or the corresponding options in the View
dropdown menu at the top of the interface.
Furthermore, when the cursor hovers over an object of interest, the information bar at the bottom of the GUI displays the current object's width, height, and other details.
For the crosshair, users can adjust the width, transparency, and color by selecting the Set Crosshair
option from the View
dropdown menu at the top of the interface.
Moreover, as the cursor moves, the information bar at the bottom of the GUI displays real-time position coordinates.
At present, X-AnyLabeling
provides functionalities for importing and exporting a variety of mainstream label file formats. Below is a brief guide on how to use these features.
The latest version of X-AnyLabeling supports one-click import/export for YOLOv5/v8 label files (*.txt) for object detection, instance segmentation, rotated bounding box detection, and keypoint detection tasks.
Before importing/exporting YOLO label files, you need to prepare a label configuration file:
- For YOLO object detection, instance segmentation, and rotated bounding box detection tasks, refer to classes.txt. Each line represents a class, with numbers incrementing from 0.
- For YOLO keypoint detection tasks, refer to yolov8_pose.yaml. For the
has_visible
parameter, please refer to the official definition.
To export in YOLO-Pose format, you need to assign a
group_id
to each set (bounding box and its keypoints) during annotation so that X-AnyLabeling can understand their relationships during export.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Upload the prepared configuration file.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Upload the prepared configuration file.
- Check the appropriate options as needed and click OK.
The export path defaults to the labels
folder in the same directory as the current image directory.
For a sample YOLO label file, refer to demo.txt.
The latest version of X-AnyLabeling supports one-click import/export for Pascal-VOC label files (*.xml) for detection and segmentation tasks.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Check the appropriate options as needed and click OK.
The export path defaults to the Annotations
folder in the same directory as the current image directory.
For a sample VOC label file, refer to demo.xml.
The latest version of X-AnyLabeling supports one-click import/export for COCO label files (*.json) related to object detection and instance segmentation tasks.
Before importing/exporting COCO label files, prepare a label configuration file, referring to classes.txt, where each line represents a class, with numbers incrementing from 0.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Upload the prepared configuration file.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Upload the prepared configuration file.
- Click OK.
The export path defaults to the annotations
folder in the same directory as the current image directory.
For a sample COCO label file, refer to instances_default.json.
The latest version of X-AnyLabeling supports one-click import/export for DOTA label files (*.txt). The label format is defined as:
x1 y1 x2 y2 x3 y3 x4 y4 class_name difficult
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Click OK.
The export path defaults to the labelTxt
folder in the same directory as the current image directory.
For a sample DOTA label file, refer to demo_obb.txt.
The latest version of X-AnyLabeling supports one-click import/export for semantic segmentation mask label files (*.png).
Before importing/exporting mask label files, prepare the configuration file as follows:
- For color images, refer to mask_color_map.json.
- For grayscale images, refer to mask_grayscale_map.json.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Upload the prepared configuration file.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Upload the prepared configuration file.
- Click OK.
The export path defaults to the mask
folder in the same directory as the current image directory.
The latest version of X-AnyLabeling supports one-click import/export for multi-object tracking label files.
Before importing/exporting label files, prepare a label configuration file, referring to classes.txt, where each line represents a class, with numbers incrementing from 0.
Export Task:
- Click the
Export
button in the top menu bar. - Upload the prepared configuration file.
- Choose the save path and click OK.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Upload the prepared configuration file.
- Choose the directory containing the label file (
gt.txt
) and click OK.
For sample label files, refer to the MOT directory, which includes three subfiles:
seqinfo.ini
,det.txt
, andgt.txt
.
seqinfo.ini
The seqinfo.ini
file contains sequence information, describing metadata for the dataset. The file includes:
[Sequence]
name = MOT # Sequence name
imdir = mot_label # Image directory
framerate = 30 # Frame rate
seqlength = 249 # Sequence length (number of frames)
imwidth = 1280 # Image width
imheight = 720 # Image height
imext = .jpg # Image file extension
det.txt
The det.txt
file contains detection results, with each line representing a detection box. The file includes:
Frame number, Track ID, Top-left x-coordinate, Top-left y-coordinate, Width, Height, Confidence, <x>, <y>, <z>
The last three fields are for the MOT3D
task and are set to -1 by default.
gt.txt
The gt.txt
file contains tracking annotation information, with each line representing an annotation box. The file includes:
Frame number, Track ID, Top-left x-coordinate, Top-left y-coordinate, Width, Height, Validity flag, Class ID, Visibility ratio
The validity flag indicates whether the current trajectory is valid, with 0
for invalid data (ignore) and 1
for valid data (activate). Users can set this using the useDifficult
flag in the label manager, where ☑️ indicates an invalid trajectory.
Additionally, for the MOTS dataset format, the v2.4.0+ version offers corresponding export settings. The specific steps for implementation are as follows:
- Click on the
Export
-Export MOTS Annotations
button in the top menu bar. - Upload the prepared configuration file.
- Select the save path and click 'OK' to proceed.
It is important to note that the default exported mots labels are not in the final official dataset format. Here, we provide the corresponding conversion code for reference:
python3 tools/label_converter.py --task mots --mode custom_to_gt --src_path /path/to/your/custom_gt.txt
Note
Before executing the conversion, you need to install the pycocotools
library first.
The latest version of X-AnyLabeling (v2.4.0+) supports one-click import/export for the following two PPOCR tasks:
- Text Detection and Recognition: Locates text areas in the input image and recognizes the text content.
- Key Information Extraction: Extracts key information from images, including semantic entity recognition and relation extraction.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Choose the appropriate label file and click OK to upload.
Export Task:
- Click the
Export
button in the top menu bar. - Click OK.
For the Text Detection and Recognition task, the export path defaults to the ppocr-rec
folder in the same directory as the current image directory, which contains:
Label.txt
: Annotation resultsrec_gt.txt
: Recognition resultscrop_img
: Images corresponding to the recognition results for training
For the Key Information Extraction task, the export path defaults to the ppocr-kie
folder in the same directory as the current image directory, which contains:
class_list.txt
: List of label classesppocr_kie.json
: KIE annotation results
For sample label files, refer to ppocr-rec and ppocr-kie.
The latest version of X-AnyLabeling supports one-click import/export for Grounding task-related label files, specifically ODVG annotations.
Before importing/exporting ODVG label files, you need to prepare a label configuration file. For reference, see classes.txt, where each line represents a category, with the numbering incrementing from top to bottom.
Import Task:
- Click the
Upload
button in the top menu bar. - Select the corresponding task.
- Choose the directory where the label files are located and click OK.
Export Task:
- Click the
Export
button in the top menu bar. - Select the corresponding task.
- Upload the prepared configuration file.
- Choose the save path and click OK.
For the style of ODVG label files, refer to ODVG.
X-AnyLabeling
includes a data statistics feature, allowing users to easily access an overview of the current task's data. By selecting the Tools dropdown in the top menu bar and clicking on Overview, users can view the current data status. This feature supports the following:
- One-click export of statistical reports
- Statistics for a specified range of data
- Label statistics for both image and object dimensions
To use the save sub-images feature, follow these steps:
- Prepare a custom class file. For an example, refer to classes.txt.
- Click on the Tools -> Save Sub-Images option in the top menu bar, and upload the corresponding custom class file. A sub-image folder named
x-anylabeling-crops
will be generated in the current directory, containing the targets categorized by class name.
X-AnyLabeling
offers global management of label objects. Users can perform the following operations:
- Delete Labels: Remove unnecessary labels.
- Rename Labels: Update label names to align with new classification standards.
- Change Label Colors: Adjust label colors to improve distinguishability.
These actions can be accessed through the Tools -> Object Manager option in the top menu bar, opening the label management window.
X-AnyLabeling
provides a shape type conversion feature, allowing users to change shape types through the Tools option in the top menu bar. The supported conversions include:
- Rectangular Box to Rotated Box: Convert rectangular box labels to rotated box labels.
- Rotated Box to Rectangular Box: Convert rotated box labels to rectangular box labels.
- Polygon to Bounding Box: Convert polygon labels to bounding box labels.
Note: The Rotated Box to Rectangular Box
and Polygon to Bounding Box
conversions use the maximum bounding rectangle by default, which may result in the loss of some label information, such as rotation angle. These actions are irreversible, so use them with caution.
To implement the masked image saving feature, follow the steps below:
- For areas that require
masking
, they can be identified usingrectangle
,rotation
, orpolygon
objects, with the label name set to__mask__
; - Click on the Tools -> Save Masked Image option in the top menu bar to set the fill color block. The default value is (114, 114, 114). The resulting images are saved by default in the
x-anylabeling-mask-image
folder.
In the top menu bar, users can click on Help -> Information to view detailed information about the current version, including version number and runtime environment.
In the top menu bar, users can select the desired language from the Language dropdown menu. The software currently supports Chinese and English. After switching the language, the software will automatically restart. Please ensure that all data is saved before switching to prevent data loss.
The user configuration file for X-AnyLabeling
is located in the .xanylabelingrc
file in the current user's directory. You can find this file at the following locations:
- Linux:
~/.xanylabelingrc
- Windows:
C:\Users\<username>\.xanylabelingrc
In this configuration file, you can adjust various user-customized settings, such as interface layout, keyboard shortcuts, and more.
The current default keyboard shortcuts in X-AnyLabeling are as follows. Users can modify them according to their needs to avoid conflicts:
Shortcut | Function |
---|---|
d | Open the next file |
a | Open the previous file |
Ctrl + Shift + d | Open the next checked/unchecked file |
Ctrl + Shift + a | Open the previous checked/unchecked file |
p or Ctrl + n | Create a polygon |
o | Create a rotated box |
r or Ctrl + r | Create a rectangular box |
i | Run the model |
q | Positive sample point in SAM Mode |
e | Negative sample point in SAM Mode |
b | Clear hint points quickly in SAM Mode |
f | Confirm completion in SAM Mode |
g | Group selected objects |
u | Ungroup selected objects |
s | Hide selected objects |
w | Show selected objects |
Alt + g | Edit group id |
Ctrl + Delete | Delete label file |
Ctrl + Shift + Delete | Delete image file |
Ctrl + q | Exit the current application |
Ctrl + i | Open image file |
Ctrl + o | Open video file |
Ctrl + u | Load all images from a directory |
Ctrl + e | Edit labels |
Ctrl + j | Edit polygons |
Ctrl + c | Copy selected objects |
Ctrl + v | Paste selected objects |
Ctrl + d | Copy polygons |
Ctrl + g | Show annotation statistics for current task |
Ctrl + h | Show all objects in current image |
Ctrl + p | Toggle preserve previous mode |
Ctrl + y | Toggle auto-use last label |
Ctrl + m | Activate batch annotation |
Ctrl + a | Enable auto annotation |
Ctrl + s | Save current annotations |
Ctrl + l | Show/Hide labels |
Ctrl + t | Show/Hide text |
Ctrl + Shift + s | Change output directory |
Ctrl + 0 | Zoom to original size |
Ctrl + + or Ctrl += | Zoom in |
Ctrl + f | Fit to window |
Ctrl + Shift + f | Fit to width |
Ctrl + Shift + m | Merge selected rectangle shapes |
Ctrl + z | Undo last action |
Delete | Delete selected shape |
Esc | Deselect object |
Backspace | Delete selected point |
↑→↓← | Move selected object using keyboard arrows |
zxcv | Rotate selected rotation using the keyboard |
To modify custom label colors, follow these steps:
- Open the configuration file
.xanylabelingrc
in your user directory using a text editor or command-line tool. - Locate the
shape_color
field and set its value to "manual" to manually set label colors. - Find the
label_colors
section, which contains the labels and their corresponding colors. - Locate the label you want to modify, such as "person," "car," "bicycle," etc.
- Set the color using RGB values, e.g.,
[255, 0, 0]
for red,[0, 255, 0]
for green, and[0, 0, 255]
for blue. - Replace the color values for the corresponding label, save the file, and close the editor.
Example configuration:
...
default_shape_color: [0, 255, 0]
shape_color: manual # null, 'auto', 'manual'
shift_auto_shape_color: 0
label_colors:
person: [255, 0, 0]
car: [0, 255, 0]
bicycle: [0, 0, 255]
...
...
After completing these steps, the custom label colors will be applied. The next time you use these labels during annotation, they will display in the colors you set.
In X-AnyLabeling v2.4.0+, label colors can be directly set through the GUI. Navigate to
Tools
->Label Manager
in the menu bar. Note that these changes are only effective for the current session.
To load predefined labels
, you can modify the labels
field in the configuration file. When defining label names with pure numbers, be sure to enclose them in single quotes ''
. Example:
...
labels:
- car
- '1'
- apple
- _phone
In X-AnyLabeling v2.4.0 and above, there is a feature for auto-switching to edit mode. You can configure this in the auto_switch_to_edit_mode
field in the configuration file:
Option | Function |
---|---|
true | Automatically switches to edit mode after creating an object. |
false | Allows the creation of multiple objects of the same type continuously; manual switch to edit mode is required. |
In X-AnyLabeling v2.4.0 and above, the hover auto-highlight mode feature is available. You can set this using the auto_highlight_shape
field in the configuration file:
Option | Function |
---|---|
true | Automatically highlights objects when hovering over them with the mouse, facilitating quick adjustments to the selected object. |
false | Requires the user to manually click on an object to highlight it when hovering. |
Note: In multi-label classification tasks
, if the user manually uploads a property file, the auto_highlight_shape
field will be set to false
to prevent accidental switching of the property window status bar, thus improving user experience.
- Semantic & Instance Segmentation: Link
- Keypoint Detection: Link
- Multi-Object Tracking: Link
- Depth Estimation: Link
- Interactive Video Object Segmentation: Link
- Image Matting: Link
For information on how to load and export models, refer to the custom_model.md document.