You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

0 Días
13 Hrs
54 Min
25 Seg

Etiquetado de Imágenes con Label Studio

15/16
Resources

The detection of objects in images using artificial intelligence is a fascinating technology that is transforming multiple industries. Behind these systems is a fundamental process: data labeling. This process, although laborious, is essential to train models that can identify specific objects in images. Let's explore how to perform this manual labeling using professional tools and prepare our data to train object detection models.

How does manual image labeling work for AI models?

Manual labeling is the process by which we identify and mark specific objects in images so that AI models learn to recognize them. To perform this process, we will use Label Studio, a specialized tool formerly known as Labelimage.

To begin, we need to install Label Studio using the following command:

pip install label-studio

Once installed, we can start the application with the command:

label-studio

This command launches a local server on port 8080 (localhost:8080) that allows us to access the Label Studio interface. An important advantage is that we can launch this process on a virtual machine, allowing our entire team to access the same URL to collaborate on labeling.

How to create a labeling project in Label Studio?

To start our labeling work, we need to create a new project:

  1. Click on "Create" to start a new project.
  2. Define a name for the project (in our example: "Platzi Demo")
  3. Add a detailed description (for example: "Detection of helmets and vests")

After configuring the basic project information, we proceed to import our images. Label Studio supports multiple file formats, which makes it very versatile. We can either drag our images directly or load them using the corresponding button.

How to configure the labels for object detection?

Once the images are loaded, we must configure the type of labeling we will perform:

  1. In the "Labeling Setup" section, we select the option for object detection with bounding box (rectangles).
  2. Choose the manual configuration
  3. We define our custom labels:
    • Remove the default labels
    • Add "helmets" (with bright green color)
    • Add "vests" (with red color)
  4. Save the configuration

How to perform the image tagging process?

The tagging process consists of marking each relevant object in our images:

  1. Select an untagged image
  2. Choose the corresponding label (e.g. "helmets")
  3. Draw a rectangle around the object in the image.
  4. If there are more objects, repeat the process with their respective tags.
  5. Click on "Submit" to save the labeling.

It is important to note that the accuracy of the rectangle enclosing the object directly influences the quality of the resulting model. The more accurate the labeling, the better the performance of the AI model.

This process must be repeated for each image in the dataset. In professional environments, when working with thousands of images, there are usually teams dedicated exclusively to labeling or specialized companies are hired to perform this task.

How to export the labeled data to train YOLO models?

Once the labeling of all the images is completed, we can export the results:

  1. We go to the main page of the project.
  2. Click on "Export".
  3. Select the YOLO format
  4. Choose if we want to export only the labels or also the images.

Label Studio allows us to export in a format compatible with YOLO v8, which also works correctly with YOLO v11 and other versions.

How to prepare the dataset to train a detection model?

After exporting and unzipping our labeled dataset, we get:

  1. Images folder
  2. Labels folder
  3. Class file (helmets, vests)
  4. Notes about YOLO

To train a detection model, we need to divide our dataset into three subsets:

  • Training (train): 70% of the images
  • Test: 20% of the images
  • Validation (val): 10% of the images.

We can use a script to perform this division automatically:

# Script to divide the dataset into training, test and validation# Parameters: directory containing images and tags# Division: 70% training, 20% test, 10% validation

Finally, we need to create a YAML configuration file that specifies the paths to our data and the classes to detect:

train: path/to/train/imagesval: path/to/valid/imagestest: path/to/test/images
 nc: 2 # number of classesnames: ['helmets', 'vests'] # class names.

With these steps, our dataset is fully prepared to train an object detection model using YOLO or other similar architectures.

Manual image labeling is a fundamental process for creating custom AI models that detect specific objects. Although it requires time and dedication, the results can transform the way we automate visual recognition tasks. Are you up for creating your own labeled dataset? Share your experiences and results in the comments.

Contributions 0

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?