Welcome to ROSMASTER M3 repository
04.Data Annotation
Training Dataset Annotation
Training Dataset Annotation1. Course Content2. Example Dataset3. Annotating Traffic Sign Dataset3.1 Label Studio Introduction3.2 Start Label Studio3.3 Access Label Studio3.4 Create Project3.5 Import Images3.6 Label Settings3.7 Dataset Annotation3.8 Export Dataset3.9 Organize Dataset Directory Structure3.10 Dataset Configuration File4. Annotating Lane Detection Dataset4.1 Create Project4.2 Organize Export Dataset4.3 Dataset Configuration File
[!IMPORTANT]
- The factory image already contains preset datasets required for training traffic sign recognition models and lane recognition models. This section tutorial is provided for users who need to train YOLOv11 models themselves and want to learn how to collect and annotate their own datasets.
- If you want to experience the complete functionality directly, you can skip this section!!!
1. Course Content
- Master the data annotation method for datasets required to train YOLOv11 object detection models.
2. Example Dataset
- The factory image already contains datasets required for training YOLOv11 traffic sign recognition models and lane recognition models. You can find the corresponding datasets in the following paths on the vehicle or in the files of this section.
- Traffic sign dataset path
~/yahboomM3_ws/yolo_train/train_sign/roadsign_dataset.zip- Lane dataset path
xxxxxxxxxx~/yahboomM3_ws/yolo_train/train_lane/lane_dataset.zip
3. Annotating Traffic Sign Dataset
3.1 Label Studio Introduction
Label Studio is an open-source data annotation platform for data annotation and annotation task management, supporting various types of data input and annotation formats.

[!NOTE]
The factory image environment has already installed Label Studio!!! If users need to set up a data annotation environment on their own computers, they need to install Label Studio first.
Installation command is as follows:
xxxxxxxxxxpip install label-studio
3.2 Start Label Studio
ROSMASTER-M3 uses uv to manage Python package environments. Label Studio is installed in the uv environment of the yahboomM3 workspace.
- Activate uv environment
xxxxxxxxxxsource /home/jetson/yahboomM3_ws/.venv/bin/activate- Start Label Studio
xxxxxxxxxxlabel-studio
3.3 Access Label Studio
Ensure the computer and vehicle are on the same local area network. Enter the vehicle IP + port 8080 in the browser address bar. The vehicle IP can be viewed from the OLED screen in front of the vehicle or by opening a new terminal. Here we use IP:192.168.12.33 as an example:
xxxxxxxxxx192.168.12.33:8080
- Factory preset account information (all locally stored information, no data leakage risk):
xxxxxxxxxxAccount: yahboom@163.comPassword: yahboom@163.com- If you need to create a new account, click
sign up. If using the factory preset account, log in directly.


After registration is completed, the website will automatically log in:

3.4 Create Project

Project name can be named arbitrarily, name it according to your training set:

3.5 Import Images
- Import the images previously split from the video: Do not import too many images at once. It is recommended to select 50-100 images each time, then import multiple times.

3.6 Label Settings
- Select "Object Detection" model

- Delete built-in labels:

- Enter a label name in
Add Label names, then clickAddto add it. - In this example, we name all traffic signs and ground signs in the sandbox配套地图.
[!TIP]
- The label names here are not fixed, you can name them according to your needs.
- If users want to train other types of object detection models, and the detection targets are not traffic signs or lanes, name the labels according to the targets that need to be detected in your dataset.

3.7 Dataset Annotation
- Return to the main page, then click Annotate All Tasks:

- The shortcut keys for the corresponding target categories are displayed at the bottom of the label. Press the corresponding shortcut key on the keyboard to quickly select the label.

- Then drag the mouse to select the target corresponding to the selection. There are 4 types of targets in the figure here. After marking is completed, the marked labels will be displayed in the
Regionscolumn on the right, where you can check whether the marking is correct.

- After marking is completed, click
Submitto submit, and it will automatically jump to the next image. Repeat the annotation until all image data annotation is completed.

3.8 Export Dataset
- Select the project to export, click
Exportin the upper right corner

- Select
YOLO with Imagesformat to export, the browser will automatically download a compressed package

3.9 Organize Dataset Directory Structure
- The directory structure corresponding to the compressed package exported by Label Studio is as follows:
xxxxxxxxxx.├── images├── labels├── classes.txt└── notes.jsonFolder and file descriptions:
- images: Contains original images
- labels: Annotation data corresponding to each image
- classes.txt: Target categories
- notes.json: Target categories and corresponding numbers
- To enable YOLOv11 to recognize the dataset, some adjustments need to be made to the directory structure of data exported from Label Studio
- Split the images and labels exported by Label Studio into train (training set) and val (validation set). The images and labels in train and val need to correspond one-to-one in name.
- Here for the example, we directly copy the images and labels in the train directory into the val directory
xxxxxxxxxx.├── classes.txt├── notes.json├── train│ ├── images│ └── labels└── val ├── images └── labels
- The following is the directory structure of the tutorial example dataset (the dataset provided in the factory vehicle image and this section tutorial folder is in .zip compressed package format, you need to unzip it first to see the complete directory structure)

3.10 Dataset Configuration File
- When training YOLOv11 models, you need to specify the dataset path and detection target categories through a yaml format configuration file.
- Traffic sign dataset configuration file path:
xxxxxxxxxx/home/jetson/yahboomM3_ws/yolo_train/train_sign/sign.yamlContent analysis:
- path: Dataset path
- train: Training set path
- val: Validation set path
- names: Detection target categories (need to be consistent with the sequence categories in notes.json exported from Label Studio)
xpath/home/jetson/yahboomM3_ws/yolo_train/roadsign_dataset # dataset root dirtraintrain/images valval/images # Classesnames 0greenlight 1honking 2parkA 3parkB 4redlight 5school 6sidewalk 7sidewalk_ground 8speedlimit 9stop 10straight 11turnright 12turnright_ground 13yellowlight
4. Annotating Lane Detection Dataset
The lane detection dataset annotation process is basically the same as the traffic sign dataset annotation process, both use YOLOv11's object detection model for object detection (here it is recommended to use object detection model, not recommended to use segmentation model for lane detection, model inference speed is slower)
4.1 Create Project
- The creation process is consistent with the previous one. Here fill in
train_laneforProject Name.

- Here the lane detection model category has only one, fill in
lane

- Import the split lane video frame dataset

- The annotation method is consistent with the previous one. Here we box and annotate all lane lines

4.2 Organize Export Dataset
- After annotation is completed, we export and organize the dataset into a target structure recognizable by YOLO. The method is completely consistent with the previous traffic sign dataset export and organization method.
- Reference target structure is as follows:

4.3 Dataset Configuration File
- Lane detection dataset configuration file path:
xxxxxxxxxx