This guide provides comprehensive instructions for using X-AnyLabeling, covering everything from basic file management and annotation tasks to advanced features and customization.
- 1. File Management
- 2. Editing
- 3. View Options
- 4. Annotation Formats (Import/Export)
- 5. Toolbar Tools
- 6. Help and Language
- 7. Configuration
- 8. Supported Tasks
- 9. Custom Models
- 10. Chatbot
This section explains how to import, manage, and save data in X-AnyLabeling. You can import images and videos using various methods, including menu options and keyboard shortcuts. It also covers deleting data, switching between images, and saving labels, helping you maintain an efficient workflow and manage your data securely.
After opening the application, select the type of data you want to import from the File
menu or use the keyboard shortcuts:
X-AnyLabeling supports importing data in the following ways:
- Image File Directory (
Ctrl+U
): Import all image files within a selected directory, including those nested in subdirectories. - Single Image File (
Ctrl+I
): Import an individual image file (formats:*.jpg
,*.png
,*.bmp
,*.webp
,*.tif
). - Single Video File (
Ctrl+O
): Import an individual video file (formats:*.mp4
,*.avi
,*.mov
,*.mkv
,*.wmv
,*.flv
). Video frames will be extracted for annotation.
X-AnyLabeling offers the following options for deleting data:
- Delete Label File (
Ctrl+Delete
): Deletes the annotation file (.json
) associated with the currently displayed image. Warning: This action cannot be undone. - Delete Image File (
Ctrl+Shift+Delete
): Moves the currently displayed image file and its corresponding label file (if any) to a_delete_
subfolder within the image directory.
Navigate between images in your dataset using these methods:
- Next/Previous Image: Use the
D
key (next) orA
key (previous) to move sequentially through the image list. - Jump to Annotated/Unannotated:
Ctrl+Shift+D
: Jump to the next image that already has annotations.Ctrl+Shift+A
: Jump to the previous image that already has annotations. (Note: The behavior ofCtrl+Shift+D
/Ctrl+Shift+A
can be configured to jump to the next/previous unannotated image instead. Modify theswitch_to_checked
field in the user configuration file.)
- Jump to Specific Image: Type the exact filename (including extension) into the file search bar at the bottom right and press
Enter
.
X-AnyLabeling enables auto-save by default. You can verify or toggle this setting via File
> Auto Save
.
Label files are saved in *.json
format in the same directory as the images by default. The structure is:
{
"version": "${version}", // X-AnyLabeling version
"flags": {}, // Image-level flags (if any)
"shapes": [ // List of annotated shapes
{
"label": "${label}", // Category label
"score": null, // Confidence score (e.g., from model), null if N/A
"points": [...], // List of [x, y] coordinates defining the shape
"group_id": null, // ID for grouping related shapes (e.g., pose keypoints)
"description": null, // Optional text description for the shape
"difficult": false, // Flag if the object is difficult to identify
"shape_type": "${shape_type}", // e.g., "rectangle", "polygon"
"flags": null, // Shape-level flags (if any)
"attributes": {} // Dictionary of custom attributes
}
// ... more shapes
],
"description": null, // Optional text description for the image
"chat_history": [ // Chat history (for chatbot)
{
"role": "user",
"content": "Hi",
"image": null
},
{
"role": "assistant",
"content": "Hi there! How can I help you today?",
"image": null
}
// ... more dialogs
],
"imagePath": "${filename}", // Relative path to the image file
"imageData": null, // Base64 encoded image data (if enabled, see 1.5)
"imageHeight": -1, // Image height in pixels
"imageWidth": -1 // Image width in pixels
}
File
> Change Output Directory
and choose your preferred path. The relative imagePath
in the JSON will be adjusted accordingly.
To embed the image data (encoded in base64
by default) directly into the .json
label file, enable the Save Image Data
option under the File
menu. This increases the JSON file size but makes it self-contained.
This section explains how to create, edit, and manage different types of annotation objects (shapes) and their associated labels in X-AnyLabeling.
In X-AnyLabeling, each distinct annotated object is called a shape
. Key properties stored for each shape include:
Field | Type | Description |
---|---|---|
label |
String | Category label of the object. |
score |
Float | Confidence score (often from AI model inference). null if not available. |
points |
Array | List of [x, y] coordinates defining the shape vertices. |
group_id |
Integer | ID to group multiple related shapes (e.g., keypoints for a pose). null if not grouped. |
description |
String | Optional text description for the shape. |
difficult |
Boolean | Flags the object as difficult to identify (true if difficult). |
shape_type |
String | Type of shape, e.g., "rectangle" , "polygon" . |
flags |
Dictionary | Dictionary for additional flags or attributes. null if none. |
attributes |
Dictionary | Dictionary for custom object attributes. Empty {} if none. |
kie_linking |
List | Information linking shapes (e.g., for Key Info Extraction). Empty [] if none. |
For detailed field definitions, see shape.py
.
X-AnyLabeling supports creating the following types of shapes:
- Rectangle (
R
): Click and drag to define opposite corners, or click once for the first corner and again for the second. - Rotated Rectangle (
O
): Click to set the first point, click again for the second point defining one side, then move the cursor to set the height and click a third time. - Polygon (
P
): Click along the object's boundary to place vertices. Click the starting point or double-click the last point to close the polygon. Requires at least 3 points. - Point: Click to place a point.
- Line: Click to set the start point, move the cursor, and click again to set the end point.
- Line Strip: Click to place the first point, then click to add subsequent points for connected line segments. Double-click to finish.
- Circle: Click to set the center, move the cursor to define the radius, and click again.
You can create shapes using the tools in the left toolbar, the right-click context menu, or keyboard shortcuts.
X-AnyLabeling operates in two main modes:
- Drawing Mode: Allows you to continuously create new shapes of the selected type.
- Editing Mode: Allows you to select and modify existing shapes (move, resize, rotate, delete (
Delete
), undo (Ctrl+Z
), copy (Ctrl+C
), paste (Ctrl+V
)).
Switching Modes:
- Select a drawing tool from the left toolbar to enter Drawing Mode for that shape type.
- Press
Ctrl+E
to toggle Edit Mode on/off. Clicking an existing shape also typically enters Edit Mode.
Editing Operations:
- General: Select shapes by clicking on them in Edit Mode. Hold
Shift
to select multiple shapes. Drag selected shapes to move them. - Rectangles: Resize by dragging corner or edge handles.
- Polygons:
- In Edit Mode (
Ctrl+E
), drag an edge to add a new vertex. - Hold
Shift
and click a vertex to remove it. - Press
Ctrl+J
to enter a dedicated polygon point editing mode for fine-tuning vertex positions.
- In Edit Mode (
- Rotated Rectangles: Select the shape and use
Z
,X
,C
,V
keys to rotate it (check config/tooltips for rotation step/direction). The rotation angle is displayed in real-time (enable via View menu if needed). - Merging Shapes: Select multiple shapes, right-click, and choose
Merge Selected Objects
to create a single axis-aligned bounding rectangle around them. - Selecting All Shapes on Canvas:
- Switch to Edit Mode (
Ctrl+E
). - Click any label in the
Label List
panel (usually on the right) to focus it. - Hold
Shift
, pressHome
(selects all shapes above the focused label), then pressEnd
(selects all shapes below).
- Switch to Edit Mode (
When you create a shape or select an existing one in Edit Mode, the label panel appears (usually on the right), allowing you to edit its properties:
Field | Description |
---|---|
Shape Label | Enter or select the object's category label (supports fuzzy search). |
Group ID | Assign a numeric ID to group related shapes (e.g., for poses, tracking). |
Difficult | Check this box if the object is difficult to recognize. |
Label List | Displays available labels, allowing selection. |
Description | Add optional text notes specific to this shape instance. |
Label Linking | Used for linking shapes in tasks like Key Information Extraction (KIE). |
Attributes | (If configured) Set custom attributes for the shape. |
X-AnyLabeling allows you to add a description or caption to the entire image:
- Enter Edit Mode (
Ctrl+E
). - Click on an empty area of the canvas (not on a shape).
- Enter your text in the
Description
field in the right panel. This is saved in theflags
field of the main JSON structure.
This section explains how to customize the view settings in X-AnyLabeling, including adjusting the canvas, image appearance, and how shape information is displayed, to optimize your workflow.
- Zoom In (
Ctrl + +
orCtrl + =
) - Zoom Out (
Ctrl + -
) - Zoom to Actual Size (100%) (
Ctrl + 0
) - Zoom to Fit Window (
Ctrl + F
) - Zoom to Fit Width (
Ctrl + Shift + F
)
In addition to using menu options and shortcuts, you can zoom dynamically by holding Ctrl
and using the mouse scroll wheel. This is useful for precise annotations, especially on small objects.
To maintain the current zoom level when switching between images, enable View
> Keep Previous Zoom Ratio
.
X-AnyLabeling allows you to adjust the brightness and contrast of the current image for better visibility:
- Select
View
>Brightness Contrast
to open the adjustment controls. - To apply the current adjustments to all subsequent images in the session, enable
View
>Keep Current Brightness
andView
>Keep Current Contrast
.
The status bar at the bottom displays the current filename, annotation progress (e.g., "Image 5/100"), and cursor coordinates.
You can control the visibility of various shape attributes:
- Toggle display of label names next to shapes (
Ctrl+L
orView
>Show Labels
). - Toggle display of shape descriptions (
Ctrl+T
orView
>Show Text
). - Toggle display of other info like Group IDs, rotation angles, scores (check
View
menu for options).
When you hover over a shape, its dimensions (width and height) are displayed in the status bar.
The panel on the right includes Label Filters and Group ID Filters. Use these dropdowns or text boxes to show only shapes matching specific labels or group IDs, hiding all others.
You can customize the appearance (width, transparency, color) of the crosshair cursor via View
> Set Crosshair
. The status bar shows the cursor's real-time pixel coordinates.
X-AnyLabeling
supports importing and exporting annotations in various standard formats. This section provides a guide for each. Access import/export functions via the File
menu or dedicated toolbar buttons (e.g., Import Annotations
, Export Annotations
).
General Notes:
- Configuration Files: Many formats require specific configuration files (e.g., listing class names) for import/export. Ensure these are prepared correctly.
- Default Export Path: By default, exported files are saved to a format-specific subfolder (e.g.,
labels
,Annotations
,mask
) within the current image directory. You can usually specify a different output path during export.
Supports YOLOv5/v8 format (*.txt
) labels for object detection, instance segmentation, rotated bounding boxes, and keypoint detection.
Configuration:
- Detection/Segmentation/Rotation: Prepare a
classes.txt
file listing class names, one per line (0-indexed). See example:classes.txt
. - Keypoint Detection (Pose): Prepare a
*.yaml
file defining the skeleton and class names. See example:yolov8_pose.yaml
. Refer to the Ultralytics Docs for format details (e.g.,kpt_shape
,flip_idx
).
Note: For YOLO-Pose export, you must assign the same
group_id
to each bounding box and its corresponding keypoints during annotation so they are correctly associated.
Importing:
- Select
Import Annotations
>Import YOLO Annotations
. - Select the corresponding task (Detection, Segmentation, Pose).
- Provide the required configuration file (
classes.txt
or*.yaml
). - Select the directory containing the YOLO
*.txt
label files.
Exporting:
- Select
Export Annotations
>Export YOLO Annotations
. - Select the corresponding task.
- Provide the required configuration file.
- Configure options (e.g., coordinate format) if prompted and click OK.
- Export path defaults to a
labels
subfolder. Sample:demo.txt
.
Supports Pascal VOC format (*.xml
) labels for object detection (bounding boxes) and segmentation (polygons saved within the XML, if applicable).
Configuration: None usually required for standard VOC detection import/export. For segmentation, ensure labels match your desired classes.
Importing:
- Select
Import Annotations
>Import VOC Annotations
. - Select the directory containing the
*.xml
files (usually namedAnnotations
).
Exporting:
- Select
Export Annotations
>Export VOC Annotations
. - Configure options if prompted and click OK.
- Export path defaults to an
Annotations
subfolder. Sample:demo.xml
.
Supports COCO format (*.json
) labels for object detection, instance segmentation, and keypoint detection.
Configuration:
- Detection (rectangle) / Segmentation (polygon): Prepare a
classes.txt
file. For export, ensure_background_
is the first class if required by your training framework.__ignore__
can also be included. - Keypoint Detection (pose): Prepare a
*.yaml
file similar to YOLO Pose (e.g.,yolov8_pose.yaml
). - Instance Segmentation (polygon): Prepare a
labels.txt
file.
Importing:
- Select
Import Annotations
>Import COCO Annotations
. - Select the task type.
- Provide the required configuration file (
classes.txt
or*.yaml
). - Select the COCO
*.json
annotation file.
Exporting:
- Select
Export Annotations
>Export COCO Annotations
. - Select the task type.
- Provide the required configuration file.
- Click OK.
- Export path defaults to an
annotations
subfolder, saving a single*.json
file. Sample:annotations
.
Supports DOTA format (*.txt
) labels for oriented (rotated) object detection. Label format per line:
x1 y1 x2 y2 x3 y3 x4 y4 class_name difficult
Configuration: None required for import/export, class names are read/written directly.
Importing:
- Select
Import Annotations
>Import DOTA Annotations
. - Select the directory containing the
*.txt
label files (usuallylabelTxt
).
Exporting:
- Select
Export Annotations
>Export DOTA Annotations
. - Click OK.
- Export path defaults to a
labelTxt
subfolder. Sample:demo_obb.txt
.
Supports importing and exporting semantic segmentation masks as single-channel or color image files (*.png
).
Configuration: Prepare a *.json
mapping file defining the pixel value (or RGB color) for each class name.
- Color masks: See
mask_color_map.json
. - Grayscale masks: See
mask_grayscale_map.json
.
Importing:
- Select
Import Annotations
>Import MASK Annotations
. - Provide the
*.json
mapping file. - Select the directory containing the mask image files (
*.png
).
Exporting:
- Select
Export Annotations
>Export MASK Annotations
. - Provide the
*.json
mapping file. - Click OK.
- Export path defaults to a
mask
subfolder.
Supports importing and exporting Multi-Object Tracking (MOT) challenge format labels.
Configuration: Prepare a classes.txt
file listing class names (0-indexed).
Importing (gt.txt
):
- Select
Import Annotations
>Import MOT Annotations
. - Provide the
classes.txt
configuration file. - Select the directory containing the
gt.txt
file (and potentiallyseqinfo.ini
).
Exporting (creates gt.txt
, det.txt
, seqinfo.ini
):
- Select
Export Annotations
>Export MOT Annotations
. - Provide the
classes.txt
configuration file. - Choose the output directory and click OK.
Sample files (
seqinfo.ini
,det.txt
,gt.txt
) are available in theMOT
directory.
File Formats:
seqinfo.ini
: Sequence metadata (name, frame rate, dimensions, etc.).det.txt
: Detection results (used by some trackers, format:frame,id,bb_left,bb_top,bb_width,bb_height,conf,-1,-1,-1
). Exported detections might have default confidence/ID.gt.txt
: Ground truth tracking annotations (format:frame,id,bb_left,bb_top,bb_width,bb_height,valid,class_id,visibility
).id
: Corresponds to thegroup_id
assigned in X-AnyLabeling.valid
:1
for valid,0
for invalid/ignored. This corresponds to the 'Difficult' checkbox in the label editing panel; checking 'Difficult' marks the trajectory as invalid (0
).class_id
: 0-indexed based on yourclasses.txt
.
MOTS (Segmentation Tracking) Export: X-AnyLabeling (v2.4.0+) also supports exporting polygon annotations in a MOTS-compatible format.
- Select
Export Annotations
>Export MOTS Annotations
. - Provide the
classes.txt
configuration file. - Choose the save path and click OK.
Note
The exported mots_gt.txt
requires conversion to the official MOTS challenge format using a script. A sample converter is provided:
# Requires pycocotools: pip install pycocotools
python3 tools/label_converter.py --task mots --mode custom_to_gt --src_path /path/to/your/exported_mots_gt.txt
Supports importing/exporting labels for PaddleOCR (PPOCR) tasks (v2.4.0+).
Tasks Supported:
- Text Detection and Recognition: Locates text boxes and recognizes content.
- Key Information Extraction (KIE): Extracts entities and relations from text regions.
Importing:
- Select
Import Annotations
>Import PPOCR Annotations
. - Select the task (Recognition or KIE).
- Choose the appropriate label file (
Label.txt
for Rec,kie.json
for KIE).
Exporting:
- Select
Export Annotations
>Export PPOCR Annotations
. - Select the task.
- Click OK.
Export Paths & Files:
- Recognition: Defaults to
ppocr-rec
subfolder. Contains:Label.txt
: Detection & transcription annotations.rec_gt.txt
: Recognition ground truth (transcriptions only).crop_img/
: Cropped images of text regions for recognition training.
- KIE: Defaults to
ppocr-kie
subfolder. Contains:class_list.txt
: List of KIE entity classes.ppocr_kie.json
: KIE annotation results (linking text regions).
Samples: ppocr-rec
, ppocr-kie
.
Supports importing/exporting ODVG format annotations for visual grounding tasks.
Configuration: Prepare a classes.txt
file listing category names.
Importing:
- Select
Import Annotations
>Import ODVG Annotations
. - Select the directory containing the ODVG label files.
Exporting:
- Select
Export Annotations
>Export ODVG Annotations
. - Provide the
classes.txt
configuration file. - Choose the save path and click OK.
Sample:
ODVG
.
Supports importing/exporting VLM-R1-OVD format (.jsonl
) labels, often used for Open-Vocabulary Detection tasks.
Configuration (Export):
classes.txt
(Optional): Provide aclasses.txt
file to export only annotations matching those specific categories/phrases. If omitted, all unique labels found in the images are used as prompts for export.
Importing:
- Select
Import Annotations
>Import VLM-R1-OVD Annotations
. - Choose the
.jsonl
annotation file.
Exporting:
- Select
Export Annotations
>Export VLM-R1-OVD Annotations
. - (Optional) Provide the
classes.txt
file if filtering categories. - Fill in other configuration items if prompted and click OK.
- Images without any labels (or matching labels if
classes.txt
is used) are automatically skipped during export. Sample:vlm_r1_ovd.jsonl
.
The toolbar (usually at the top or integrated with the menu) provides access to additional tools and functionalities.
X-AnyLabeling
provides a data statistics tool (Tools
> Overview
) for reviewing your annotation progress.
Features:
- Flexible Scope: Analyze all images or select a specific range using sliders or input fields. Statistics update in real-time.
- Detailed Breakdown: View counts per label category and per shape type (rectangle, polygon, etc.). Get an overall dataset summary.
- Export Reports: Generate a zip archive containing detailed CSV files (
label_infos.csv
,shape_infos.csv
) and the class list (classes.txt
).
Usage:
- Go to
Tools
>Overview
. - Review the statistics displayed in the window.
- (Optional) Select a specific image range to analyze.
- Click
Export
to save the detailed reports as a zip file.
This feature saves cropped images of each annotation object (Tools
> Save Sub-Images
).
- Prepare a
classes.txt
file listing the object classes you want to crop. Seeclasses.txt
for an example. - Select
Tools
>Save Sub-Images
. - Provide your
classes.txt
file when prompted. - The cropped images will be saved into a
x-anylabeling-crops
subfolder in the current image directory, organized into subdirectories named after each class.
X-AnyLabeling
provides tools for managing labels globally across your dataset via Tools
> Label Manager
.
Operations:
- Delete Labels: Remove specific label classes entirely from the list of available labels.
- Rename Labels: Change the name of existing label classes. This updates the label list but does not automatically update existing annotations using the old name.
- Change Label Colors: Modify the display color for specific label classes for the current session only. (For persistent changes, see 7.2 Custom Label Colors).
You can convert between certain shape types using the Tools
menu. Supported conversions include:
- Rectangle to Rotated Box
- Rotated Box to Rectangle
- Polygon to Bounding Box
- Polygon to Rotated Box
Note: Converting to Rectangle or Bounding Box uses the axis-aligned bounding box, losing rotation or precise boundary information. This conversion is irreversible within the tool, so use it carefully.
This feature (Tools
> Save Masked Image
) allows you to save versions of your images where specific areas are masked (filled with a solid color):
- Annotate the areas you want to mask using
rectangle
,rotation
, orpolygon
shapes. - Assign the special label
__mask__
to these shapes. - Select
Tools
>Save Masked Image
. - Choose the fill color (default is gray
(114, 114, 114)
). - The masked images will be saved in the
x-anylabeling-mask-image
subfolder in the current image directory.
Select Help
> About
to view the application version and runtime environment details (e.g., Python version, library versions).
Select your preferred interface language (Chinese
or English
) from the Language
menu.
Important: The application will restart automatically after changing the language. Save your work before switching languages to avoid data loss.
X-AnyLabeling
stores user preferences in a configuration file named .xanylabelingrc
, located in your user's home directory:
- Linux/macOS:
~/.xanylabelingrc
- Windows:
C:\Users\<YourUsername>\.xanylabelingrc
You can manually edit this file (it's in YAML format) to customize settings like keyboard shortcuts, label colors, and default behaviors. Close X-AnyLabeling before editing and restart it afterwards for changes to take effect.
The default keyboard shortcuts are listed below. You can customize these in the .xanylabelingrc
file if needed (e.g., to resolve conflicts with system shortcuts or match personal preferences).
Shortcut | Function | Notes |
---|---|---|
d |
Next Image | |
a |
Previous Image | |
Ctrl+Shift+d |
Next Annotated/Unannotated Image | Behavior depends on switch_to_checked config |
Ctrl+Shift+a |
Previous Annotated/Unannotated Image | Behavior depends on switch_to_checked config |
p |
Create Polygon Tool | Shortcut might vary (check interface) |
o |
Create Rotated Rectangle Tool | Shortcut might vary |
r |
Create Rectangle Tool | Shortcut might vary |
i |
Run AI Model Inference | If model loaded |
q |
Add Positive Point (SAM) | SAM Interactive Segmentation Mode |
e |
Add Negative Point (SAM) | SAM Interactive Segmentation Mode |
b |
Clear Points (SAM) | SAM Interactive Segmentation Mode |
f |
Finalize Shape (SAM) | SAM Interactive Segmentation Mode |
g |
Group Selected Shapes | Assigns next available group ID |
u |
Ungroup Selected Shapes | Sets group ID to null |
s |
Hide Selected Shapes | Temporarily hide |
w |
Show Hidden Shapes | Show previously hidden shapes |
Alt+g |
Edit Group ID for Selection | Manually set group ID |
Ctrl+Delete |
Delete Current Label File (.json ) |
Irreversible |
Ctrl+Shift+Delete |
Delete Current Image & Label File | Moves to _delete_ folder |
Ctrl+b |
Open Chatbot | |
Ctrl+q |
Quit Application | |
Ctrl+i |
Open Single Image File | |
Ctrl+o |
Open Single Video File | |
Ctrl+u |
Open Image Directory | |
Ctrl+e |
Toggle Edit Mode | Switch between drawing & editing shapes |
Ctrl+j |
Edit Polygon Points | Fine-tune polygon vertices |
Ctrl+c |
Copy Selection | Copies selected shape(s) |
Ctrl+v |
Paste Selection | Pastes copied shape(s) |
Ctrl+d |
Duplicate Selection | Creates copy of selected shape(s) |
Ctrl+g |
Show Statistics (Overview Window) | Opens Data Statistics Tool |
Ctrl+h |
Toggle All Shapes Visibility | Show/Hide all annotations on canvas |
Ctrl+p |
Toggle Preserve Previous Mode | (Needs clarification - likely relates to keeping label/settings) |
Ctrl+y |
Toggle 'Use Last Label' | Auto-fills next shape with previous label |
Ctrl+m |
Toggle Batch Mode | (Needs clarification - likely multi-image annotation) |
Ctrl+a |
Toggle Auto-Annotation | (Needs clarification - likely AI-assist) |
Ctrl+s |
Save Current Annotations | Manual save (if auto-save is off) |
Ctrl+l |
Toggle Label Text Visibility | Show/Hide label names on shapes |
Ctrl+t |
Toggle Description Text Visibility | Show/Hide shape descriptions on shapes |
Ctrl+Shift+s |
Set Output Directory | Change where .json files are saved |
Ctrl+0 |
Zoom to Actual Size (100%) | |
Ctrl++ / Ctrl+= |
Zoom In | |
Ctrl+- |
Zoom Out | |
Ctrl+f |
Zoom to Fit Window | |
Ctrl+Shift+f |
Zoom to Fit Width | |
Ctrl+Shift+m |
Merge Selected Shapes | Creates bounding box around selection |
Ctrl+Shift+n |
Cycle Through Shapes | Selects next shape on canvas |
Ctrl+z |
Undo Last Action | |
Delete |
Delete Selection | Deletes selected shape(s) |
Esc |
Deselect Object / Cancel Drawing | |
Backspace |
Delete Selected Point (Polygon Edit) | While editing polygon points (Ctrl+J ) |
↑ , → , ↓ , ← |
Move Selection (Arrow Keys) | Nudge selected shape(s) |
z , x , c , v |
Rotate Selection | Rotates selected shape(s) (if applicable) |
To persistently define custom colors for specific labels:
- Open the
.xanylabelingrc
file in a text editor. - Ensure the
shape_color:
field is set tomanual
. If it'snull
orauto
, change it tomanual
. - Find or add the
label_colors:
section. - Add or modify entries for your labels using the format
label_name: [R, G, B]
, where R, G, B are integer values from 0 to 255. - Save the file and restart X-AnyLabeling.
Example configuration:
# ... other settings ...
default_shape_color: [0, 255, 0] # Default color if label not in list (Green)
shape_color: manual # Use colors defined below ('auto' cycles colors)
shift_auto_shape_color: 0 # Offset for 'auto' color cycling
label_colors:
person: [220, 20, 60] # Crimson
car: [0, 0, 142] # Navy Blue
bicycle: [119, 11, 32] # Maroon
traffic light: [255, 165, 0] # Orange
# Add more labels and their RGB colors here
# ... other settings ...
Note: Since v2.4.0, you can also temporarily change label colors for the current session via
Tools
>Label Manager
. Changes made there are not saved to the configuration file.
To define a default list of labels that appear in the "Label List" panel when you start the application:
- Open the
.xanylabelingrc
file. - Find or add the
labels:
section. - List your desired default labels, one per line, preceded by a hyphen and space.
- Important: Enclose purely numeric label names in single quotes (e.g.,
'1'
). - Save the file and restart X-AnyLabeling.
Example:
# ... other settings ...
labels:
- car
- truck
- bus
- person
- cyclist
- '1' # Numeric label needs quotes
- traffic_light
- _background_ # Common practice for some formats
# ... other settings ...
Configure whether the tool automatically switches to Edit Mode after you finish drawing a shape (v2.4.0+):
- Open
.xanylabelingrc
. - Find the
auto_switch_to_edit_mode:
field.true
: Switch to Edit Mode automatically after drawing a shape.false
: Stay in Drawing Mode to create multiple shapes of the same type consecutively. Manual switch (Ctrl+E
or clicking shape) needed to edit.
- Save and restart.
Configure whether shapes are automatically highlighted when you hover the mouse over them (v2.4.0+):
- Open
.xanylabelingrc
. - Find the
auto_highlight_shape:
field.true
: Highlight shapes instantly on mouse hover (makes selection easier).false
: Require a click to select and highlight a shape.
- Save and restart.
Note: This is automatically set to
false
during multi-label classification tasks that use a property file, to prevent unintended selections while interacting with the property list.
Customize the default appearance of shapes (colors during drawing/selection, point size, line width) by editing the shape:
section in the .xanylabelingrc
file:
shape:
# Default drawing colors (RGBA: Red, Green, Blue, Alpha)
line_color: [0, 255, 0, 128] # Outline color (Green, semi-transparent)
fill_color: [220, 220, 220, 150] # Fill color (Light Gray, semi-transparent)
vertex_fill_color: [0, 255, 0, 255] # Vertex color (Green, opaque)
# Colors when selected/hovered (RGBA)
select_line_color: [255, 255, 255, 255] # Outline color (White, opaque)
select_fill_color: [0, 255, 0, 155] # Fill color (Green, semi-transparent)
hvertex_fill_color: [255, 255, 255, 255] # Vertex color (White, opaque)
# Sizes (in pixels)
point_size: 10 # Diameter of points/vertices
line_width: 4 # Width of shape outlines
X-AnyLabeling
downloads pre-trained models used for AI-assisted features (like SAM or detection models). You can configure the download source (Model Hub). The source is determined in the following order of priority:
-
Environment Variable (Highest Priority):
- Set the
XANYLABELING_MODEL_HUB
environment variable before launching the application. - Example (Linux/macOS):
export XANYLABELING_MODEL_HUB=modelscope
- Example (Windows):
set XANYLABELING_MODEL_HUB=modelscope
- Setting this to
modelscope
forces downloads from ModelScope (often faster for users in China). Any other value (or if unset) falls back to the next priority level.
- Set the
-
Configuration File (Medium Priority):
- Edit the
model_hub:
setting in.xanylabelingrc
. - Set it to
modelscope
to use ModelScope, orgithub
(default) to use models hosted on GitHub Releases. - This setting is used only if the
XANYLABELING_MODEL_HUB
environment variable is not set tomodelscope
.
# In .xanylabelingrc language: en_US # Or zh_CN model_hub: github # Options: github, modelscope # ... other settings ...
- Edit the
-
Language Setting (Lowest Priority):
- If neither the environment variable nor the config file is explicitly set to
modelscope
, the default behavior depends on the language setting in.xanylabelingrc
:- If
language: zh_CN
(Chinese), it defaults tomodelscope
. - Otherwise (e.g.,
language: en_US
), it defaults togithub
.
- If
- If neither the environment variable nor the config file is explicitly set to
X-AnyLabeling supports various annotation tasks. Follow the links below for specific guides and examples for each task type:
- 8.1 Image Classification
- 8.2 Object Detection
- 8.3 Image Segmentation
- Semantic & Instance Segmentation (Polygons): Link
- 8.4 Pose Estimation
- Keypoint Detection: Link
- 8.5 Multi-Object Tracking
- MOT/MOTS: Link
- 8.6 Depth Estimation
- Depth Annotation: Link
- 8.7 Optical Character Recognition (OCR)
- 8.8 Interactive Video Object Segmentation (IVOS)
- IVOS: Link
- 8.9 Matting
- Image Matting (Alpha Masks): Link
- 8.10 Vision-Language Tasks
- Florence 2 Examples: Link
- 8.11 Zero-Shot Counting
- GeCo Counting by Detection/Segmentation: Link
For details on integrating and using your own custom AI models within X-AnyLabeling for assisted annotation, refer to the Custom Models guide.
- Chatbot Guide: Link