github地址:https://github.com/darkpgmr/DarkLabel
阿里云盘链接
参考博客
Arow / PgUp / PgDn / Home / End:浏览图像帧
鼠标:左(创建框),右(取消最近创建的框)
Shift +鼠标:向左(修改框),向右(删除所选框/轨迹或所有框)
Shift + DoubleClick:修改框属性(标签,ID,难度)
Ctrl +’+’/’-’:放大/缩小
Ctrl +箭头:滚动缩放窗口
Ctrl + 滚珠:放大/缩小
Ctrl +s:保存gt
F1:显示此帮助
darklabel2.4版本的给了mot格式标注,但是只支持视频,不支持图像格式。所以这里我们使用2.3版本进行使用介绍。
打开配置文件darklabel.yaml
可以自定义需要的标注格式,这里我们使用3.dark yolo + id
格式进行加载,选择格式后,标注完成会保存为对应的格式。格式列表如下图所示:
该软件支持以下自定义gt格式:
## User-defined GT Formats (format0 ~ format99)
# [format specifiers]
# - fn: video frame number (e.g. 0, 1, 2, ...),视频帧号,只支持加载视频,加载图像使用该格式,无法保存gt
# - iname: image file name (e.g. sample.png)
# - cname: class name or label of the object (e.g. dog, cat, ...) 类名
# - classid: zero-based index of object class in the classes set (e.g. 0, 1, 2, ...) , 类id,从0开始
# - id: object instance id (e.g. 0, 1, 2, ...),目标id
# - x1, y1, x2, y2, cx, cy, w, h: bounding box (xmin, ymin, xmax, ymax, xcenter, ycenter, width, height),坐标格式
# - nx1, ny1, nx2, ny2, ncx, ncy, nw, nh: normalized bounding box (e.g. nx1 = x1 / image_width, nh = h / image_height),归一化的坐标格式
# - difficult: difficult sample to train or not (it comes from pascal voc) (e.g. 0, 1)
使用3.dark yolo + id
格式进行标注,即每帧一个txt文件,每一行表示一个目标,用[类别id, tracker_id, ncx, ncy, nw, nh]进行表示
format3: # example of user-defined format (darknet yolo + object id)
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [classid, id, ncx, ncy, nw, nh]
gt_file_ext: "txt" # if not specified, default setting is used
gt_merged: 0 # if not specified, default setting is used
delimiter: " " # if not spedified, default delimiter(',') is used
classes_set: "coco_classes" # if not specified, default setting is used
name: "darknet yolo + id" # if not specified, "[fmt%d] $data_fmt" is used as default format name
3.对图像进行标注,选择目标类别person(下拉框选择其他类别),自增id。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-VeJFYJTX-1636384492990)(C:/Users/Admin/AppData/Roaming/Typora/typora-user-images/image-20211108205632148.png)]
2种跟踪方式
首先在第一帧点击Begin Interpolation,然后画目标bbox,按↓键往后几十帧,在找到该目标画出bbox,点击End Interpolation,然后就可以看到中间帧该目标都被圈住了,效果挺好的。
有两个算法可供选择,在当前帧画出多个目标bbox,然后点击next,这些算法,越往后bbox就越不准了,但是可以多个目标同时跟踪,插值效果比较好,但是只能一个一个目标跟踪,自己选择。
常用操作:
注意!!!绘制过程中要时常按压ctrl+s保存。
以上功能基本可以完成mot数据集标注,有自定义需求,可以修改yaml文件定制。
yaml配置文件部分介绍:
## Default Settings
media_path_root: "H:\\darklabel_test\\media" # if specified, image/video files are opened in this folder by default
gt_path_root: "H:\\darklabel_test\\gt" # if specified, gt files are loaded and saved in $gt_path_root\ by default
auto_gt_load: 0 # if true, gt is loaded from $gt_path_root\ when media is opened (you have to select gt format first before open media. if $gt_path_root\ is not defined, gt is loaded from media path)
gt_file_ext: "txt" # 默认保存文件格式,2.4版本支持csv文件,default gt save file format (supported formats: xml, txt)
gt_merged: 0 # 0表示每张图片一个gt文件,1表示所有图片保存在一个文件。0: save gt as separate file for each image, 1: save gt in one file
delimiter: "," # gt文件分隔符。separating delimiter of gt datum (it's effective only when gt is saved in txt)
database_name: "Unknown" # it is used when saving gt data in xml format: database_name
classes_set: "my_classes1" # predefined classes set (tag name of classes set)
# 类别名称
## Predefined Classes Sets (you can define and add your own classes set here)
my_classes1: ["person", "vehicle", "bicycle", "motorbike", "animal", "tree", "building"]
保存在同一个文件,由于gt格式只能使用iname: image file name
所以保存的是图片名字,之后可以写代码将图片名字替换为帧号。
自定义gt保存格式:
format9: # example of user-defined format (darknet yolo + object id)
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [iname, classid, id, ncx, ncy, nw, nh]
gt_file_ext: "txt" # if not specified, default setting is used
gt_merged: 1 # if not specified, default setting is used
delimiter: " " # if not spedified, default delimiter(',') is used
classes_set: "coco_classes" # if not specified, default setting is used
name: "darknet yolo + id" # if not specified, "[fmt%d] $data_fmt" is used as default format name
在线标注
github地址