- Download the executable file of labelImg from the link here: https://github.com/tzutalin/labelImg/files/2638199/windows_v1.8.1.zip.
- Extract and open the labelImg.exe GUI, shown in the following screenshot:
- Specify all the possible labels in an image in the predefined_classes.txt file in the data folder. We need to ensure that all the classes are listed in a separate line, as follows:
- Open an image by clicking Open in the GUI and annotate the image by clicking on Create RectBox, which will pop up the classes that will be selected as follows:
- Click on Save and save the XML file.
- Inspect the XML file. A snapshot of the XML file after drawing the rectangular bounding box looks as follows:
From the preceding screenshot, you should note that the bndbox contains the coordinates of the minimum and maximum values of the x and y coordinates corresponding to the objects of interest in the image. Additionally, we should also be in a position to extract the classes corresponding to the objects in image.