Article directory
foreword
When we are doing instance segmentation or target detection related projects, we usually label our data sets according to the algorithm requirements. The labeling formats are usually json, xml, txt and other formats. Comrades who are not familiar with these three common labeling formats You can move to: Convert the VOC (xml) annotation format to YOLOv5 (txt) and COCO2017 (json) formats .
This paper mainly introduces three kinds of data annotation software commonly used in the field of instance segmentation and object detection.
Instance segmentation: Labelme
Anaconda Prompt Installation
conda create -n labelme python=3.8
conda activate labelme
pip install pyqt5 # pyqt5 can be installed via pip on python3
pip install labelme==3.16.2
Annotation step
Open the software
- Enter the labelme environment in Anaconda Prompt
activate labelme
- cd to the specified folder
- then run the labelme command
- --labels: pass in all the defined class names
- –output: Specify the save address of the annotation file
(labelme) D:\dataset>labelme --labels label.txt --output output
Bulk annotation
- Click
Open Dir
to open the folder where the dataset is located - Click
Create Polygons
to create a polygon labeling form and start labeling - Choose a label category
- Click
Save
to save the annotation file of the image (json format) - Click
Next Image
to mark the next picture
Object detection: LabelImg
Anaconda Prompt Installation
conda create -n labelimg python=3.8
conda activate labelimg
pip install labelimg
Annotation step
Open the software
- Enter the labelimg environment in Anaconda Prompt
activate labelimg
- cd to the specified folder
- Then run the labelimg command
- images: folder where images are stored
- labels.txt: specifies all the categories to be labeled
(labelimg) D:\dataset>labelimg images labels.txt
Settings before labeling
Click View
to display the image below, and then tick the following options:
- Auto Save mode : When switching to the next picture, the label of the previous marked picture will be automatically saved, so that you don't need to press Ctrl+S to save each marked picture.
- Display Labels : After marking the picture, the box and label will be displayed
- Advanced Mode : In this way, the marked cross will always be suspended in the window, without having to mark a target each time, press the W shortcut key again to call up the marked cross
![](https://img-blog.csdnimg.cn/a13e2270ee3a4cef99a9af75d75e217e.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Zec552h55qE56-g6b6Z,size_19,color_FFFFFF,t_70,g_se,x_16#pic_center)
Common shortcut keys
- W: Call out the marked cross and start marking
- A: Switch to the previous picture
- D: switch to the next picture
- Ctrl+S: Save the marked label
- del: delete the marked rectangle
- Ctrl+Mouse Wheel: Press and hold Ctrl, then scroll the mouse wheel to adjust the display size of the marked image
- Ctrl+u: Select the folder where you want to annotate pictures
- Ctrl+r: Select the folder where the labeled label is stored
- ↑→↓←: Move the position of the marked rectangle
Bulk annotation
- Click
Open Dir
to open the folder where the dataset is located - Click
Create RectBox
to create a rectangular callout box and start marking - Choose a label category
- Select the label format, there are three label formats in labelimg, you can choose one:
- Pascal VOC(xml)
- YOLO(txt)
- CreateML(json)
- Click
Save
to save the annotation file of the image - Click
Next Image
to mark the next picture
Instance Segmentation & Object Detection: Colabeler
Compared with Labelme, LabelImg these annotation tools, the powerful part of the wizard annotation assistant is that it supports instance segmentation, target detection, text annotation, audio annotation and video annotation, etc. , and it is completely free, which can be called the conscience of the industry!
Elf Marking Assistant currently supports Windows/Mac/Linux platforms, and you can download the corresponding version according to your own system.
Download directly from the official website
Labeling step (take target detection as an example)
New Project
- Open the software, complete the registration and login, click New in the upper left corner, you can see that there are many types of projects supported, here select the first position to mark
- Then fill in the relevant information on the right and click Create
Bulk annotation
- There are three types of callout boxes that can be selected. Here, select the rectangle box to start marking.
- Then select the label information in the upper right corner
- Click the checkmark √ below, or
Ctrl+s
- Then you can click the previous one on the left, or directly use the left and right buttons of the keyboard to switch pictures
- Finally, click Export at the bottom left, you can choose the type of annotation file
Reference
Target detection practical nanny-level teaching! (2): Yolov5 real-time target detection
Labelme installation and use tutorial
Detailed explanation of data labeling software labelme
Data set production - use labelImg to make a data set
[Deep Learning Sample Preparation Series] - Labeling Tool: Colabeler Tutorial