Skip to content

Latest commit

 

History

History
792 lines (607 loc) · 43 KB

user_guide.md

File metadata and controls

792 lines (607 loc) · 43 KB

User Manual

This guide provides comprehensive instructions for using X-AnyLabeling, covering everything from basic file management and annotation tasks to advanced features and customization.

0. Table of Contents

1. File Management

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.

1.1 Importing Data

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.

1.2 Deleting Data

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.

1.3 Switching Images

Navigate between images in your dataset using these methods:

  • Next/Previous Image: Use the D key (next) or A 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 of Ctrl+Shift+D/Ctrl+Shift+A can be configured to jump to the next/previous unannotated image instead. Modify the switch_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.

1.4 Saving Label Data

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
}

⚠️ To save labels to a different location: Select File > Change Output Directory and choose your preferred path. The relative imagePath in the JSON will be adjusted accordingly.

1.5 Embedding Image Data

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.

2. Editing

This section explains how to create, edit, and manage different types of annotation objects (shapes) and their associated labels in X-AnyLabeling.

2.1 Creating Shapes

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.

2.2 Editing Shapes

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.
  • 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:
    1. Switch to Edit Mode (Ctrl+E).
    2. Click any label in the Label List panel (usually on the right) to focus it.
    3. Hold Shift, press Home (selects all shapes above the focused label), then press End (selects all shapes below).

2.3 Editing Labels

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.

2.4 Adding Image Captions

X-AnyLabeling allows you to add a description or caption to the entire image:

  1. Enter Edit Mode (Ctrl+E).
  2. Click on an empty area of the canvas (not on a shape).
  3. Enter your text in the Description field in the right panel. This is saved in the flags field of the main JSON structure.

3. View Options

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.

3.1 Canvas Controls

  • Zoom In (Ctrl + + or Ctrl + =)
  • 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.

3.2 Image Display

Brightness-Contrast

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 and View > Keep Current Contrast.

The status bar at the bottom displays the current filename, annotation progress (e.g., "Image 5/100"), and cursor coordinates.

3.3 Shape Display

You can control the visibility of various shape attributes:

  • Toggle display of label names next to shapes (Ctrl+L or View > Show Labels).
  • Toggle display of shape descriptions (Ctrl+T or View > 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.

Shape Display Filters

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.

3.4 Crosshair Customization

Crosshair Customization

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.

4. Annotation Formats (Import/Export)

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.

4.1 YOLO Format

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:

  1. Select Import Annotations > Import YOLO Annotations.
  2. Select the corresponding task (Detection, Segmentation, Pose).
  3. Provide the required configuration file (classes.txt or *.yaml).
  4. Select the directory containing the YOLO *.txt label files.

Exporting:

  1. Select Export Annotations > Export YOLO Annotations.
  2. Select the corresponding task.
  3. Provide the required configuration file.
  4. Configure options (e.g., coordinate format) if prompted and click OK.
  5. Export path defaults to a labels subfolder. Sample: demo.txt.

4.2 VOC Format

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:

  1. Select Import Annotations > Import VOC Annotations.
  2. Select the directory containing the *.xml files (usually named Annotations).

Exporting:

  1. Select Export Annotations > Export VOC Annotations.
  2. Configure options if prompted and click OK.
  3. Export path defaults to an Annotations subfolder. Sample: demo.xml.

4.3 COCO Format

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:

  1. Select Import Annotations > Import COCO Annotations.
  2. Select the task type.
  3. Provide the required configuration file (classes.txt or *.yaml).
  4. Select the COCO *.json annotation file.

Exporting:

  1. Select Export Annotations > Export COCO Annotations.
  2. Select the task type.
  3. Provide the required configuration file.
  4. Click OK.
  5. Export path defaults to an annotations subfolder, saving a single *.json file. Sample: annotations.

4.4 DOTA Format

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:

  1. Select Import Annotations > Import DOTA Annotations.
  2. Select the directory containing the *.txt label files (usually labelTxt).

Exporting:

  1. Select Export Annotations > Export DOTA Annotations.
  2. Click OK.
  3. Export path defaults to a labelTxt subfolder. Sample: demo_obb.txt.

4.5 Mask Format

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.

Importing:

  1. Select Import Annotations > Import MASK Annotations.
  2. Provide the *.json mapping file.
  3. Select the directory containing the mask image files (*.png).

Exporting:

  1. Select Export Annotations > Export MASK Annotations.
  2. Provide the *.json mapping file.
  3. Click OK.
  4. Export path defaults to a mask subfolder.

4.6 MOT Format

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):

  1. Select Import Annotations > Import MOT Annotations.
  2. Provide the classes.txt configuration file.
  3. Select the directory containing the gt.txt file (and potentially seqinfo.ini).

Exporting (creates gt.txt, det.txt, seqinfo.ini):

  1. Select Export Annotations > Export MOT Annotations.
  2. Provide the classes.txt configuration file.
  3. Choose the output directory and click OK.

Sample files (seqinfo.ini, det.txt, gt.txt) are available in the MOT 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 the group_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 your classes.txt.

MOTS (Segmentation Tracking) Export: X-AnyLabeling (v2.4.0+) also supports exporting polygon annotations in a MOTS-compatible format.

  1. Select Export Annotations > Export MOTS Annotations.
  2. Provide the classes.txt configuration file.
  3. 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

4.7 PPOCR Format

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:

  1. Select Import Annotations > Import PPOCR Annotations.
  2. Select the task (Recognition or KIE).
  3. Choose the appropriate label file (Label.txt for Rec, kie.json for KIE).

Exporting:

  1. Select Export Annotations > Export PPOCR Annotations.
  2. Select the task.
  3. 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.

4.8 ODVG Format

Supports importing/exporting ODVG format annotations for visual grounding tasks.

Configuration: Prepare a classes.txt file listing category names.

Importing:

  1. Select Import Annotations > Import ODVG Annotations.
  2. Select the directory containing the ODVG label files.

Exporting:

  1. Select Export Annotations > Export ODVG Annotations.
  2. Provide the classes.txt configuration file.
  3. Choose the save path and click OK. Sample: ODVG.

4.9 VLM-R1-OVD Format

Supports importing/exporting VLM-R1-OVD format (.jsonl) labels, often used for Open-Vocabulary Detection tasks.

Configuration (Export):

  • classes.txt (Optional): Provide a classes.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:

  1. Select Import Annotations > Import VLM-R1-OVD Annotations.
  2. Choose the .jsonl annotation file.

Exporting:

  1. Select Export Annotations > Export VLM-R1-OVD Annotations.
  2. (Optional) Provide the classes.txt file if filtering categories.
  3. Fill in other configuration items if prompted and click OK.
  4. Images without any labels (or matching labels if classes.txt is used) are automatically skipped during export. Sample: vlm_r1_ovd.jsonl.

5. Toolbar Tools

The toolbar (usually at the top or integrated with the menu) provides access to additional tools and functionalities.

5.1 Data Statistics (Overview)

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).

Overview Window

Usage:

  1. Go to Tools > Overview.
  2. Review the statistics displayed in the window.
  3. (Optional) Select a specific image range to analyze.
  4. Click Export to save the detailed reports as a zip file.

5.2 Save Cropped Images

This feature saves cropped images of each annotation object (Tools > Save Sub-Images).

  1. Prepare a classes.txt file listing the object classes you want to crop. See classes.txt for an example.
  2. Select Tools > Save Sub-Images.
  3. Provide your classes.txt file when prompted.
  4. The cropped images will be saved into a x-anylabeling-crops subfolder in the current image directory, organized into subdirectories named after each class.

5.3 Label Manager

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).

5.4 Shape Type Conversion

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.

5.5 Saving Masked Images

This feature (Tools > Save Masked Image) allows you to save versions of your images where specific areas are masked (filled with a solid color):

  1. Annotate the areas you want to mask using rectangle, rotation, or polygon shapes.
  2. Assign the special label __mask__ to these shapes.
  3. Select Tools > Save Masked Image.
  4. Choose the fill color (default is gray (114, 114, 114)).
  5. The masked images will be saved in the x-anylabeling-mask-image subfolder in the current image directory.

6. Help and Language

6.1 About X-AnyLabeling

About Dialog

Select Help > About to view the application version and runtime environment details (e.g., Python version, library versions).

6.2 Setting the Language

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.

7. Configuration

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.

7.1 Keyboard Shortcuts

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)

7.2 Custom Label Colors

To persistently define custom colors for specific labels:

  1. Open the .xanylabelingrc file in a text editor.
  2. Ensure the shape_color: field is set to manual. If it's null or auto, change it to manual.
  3. Find or add the label_colors: section.
  4. 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.
  5. 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.

7.3 Predefined Labels

To define a default list of labels that appear in the "Label List" panel when you start the application:

  1. Open the .xanylabelingrc file.
  2. Find or add the labels: section.
  3. List your desired default labels, one per line, preceded by a hyphen and space.
  4. Important: Enclose purely numeric label names in single quotes (e.g., '1').
  5. 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 ...

7.4 Auto-Switch to Edit Mode

Configure whether the tool automatically switches to Edit Mode after you finish drawing a shape (v2.4.0+):

  1. Open .xanylabelingrc.
  2. 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.
  3. Save and restart.

7.5 Hover Auto-Highlight

Configure whether shapes are automatically highlighted when you hover the mouse over them (v2.4.0+):

  1. Open .xanylabelingrc.
  2. 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.
  3. 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.

7.6 Shape Appearance

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

7.7 Model Download Source

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:

  1. 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.
  2. Configuration File (Medium Priority):

    • Edit the model_hub: setting in .xanylabelingrc.
    • Set it to modelscope to use ModelScope, or github (default) to use models hosted on GitHub Releases.
    • This setting is used only if the XANYLABELING_MODEL_HUB environment variable is not set to modelscope.
    # In .xanylabelingrc
    language: en_US # Or zh_CN
    model_hub: github  # Options: github, modelscope
    # ... other settings ...
  3. 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 to modelscope.
      • Otherwise (e.g., language: en_US), it defaults to github.

8. Supported Tasks

X-AnyLabeling supports various annotation tasks. Follow the links below for specific guides and examples for each task type:

  • 8.1 Image Classification
    • Image-level: Link
    • Object-level (Shape Attributes): Link
  • 8.2 Object Detection
    • Horizontal Bounding Box (HBB): Link
    • Oriented Bounding Box (OBB): Link
  • 8.3 Image Segmentation
    • Semantic & Instance Segmentation (Polygons): Link
  • 8.4 Pose Estimation
    • Keypoint Detection: Link
  • 8.5 Multi-Object Tracking
  • 8.6 Depth Estimation
    • Depth Annotation: Link
  • 8.7 Optical Character Recognition (OCR)
    • Text Detection & Recognition: Link
    • Key Information Extraction (KIE): Link
  • 8.8 Interactive Video Object Segmentation (IVOS)
  • 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

9. Custom Models

For details on integrating and using your own custom AI models within X-AnyLabeling for assisted annotation, refer to the Custom Models guide.

10. Chatbot

  • Chatbot Guide: Link