1.環境
windows
DarkLabel
2.準備
(1)標注工具
DarkLabel2.4.zip-深度學習檔案類資源-CSDN下載
官方GitHub地址
(2)需要標注的視頻
自己準備
3.設計自己的標注格式
?
上面是DarkLable解壓后的目錄,如果要修改對應的配置,我們可以直接在darklabel.yml檔案中進行修改,這里面的內容提供原始碼的作者已經進行了解讀:
%YAML:1.0
---
## 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: "xml" # default gt save file format (supported formats: xml, txt, csv)
gt_merged: 0 # 0: save gt as separate file for each image, 1: save gt in one file
delimiter: "," # 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>database_name</database>
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"]
coco_classes: ["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"]
voc_classes: ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
## GUI Settings (you can also enter double quoted virtual key code for hotkeys: e.g. "32" for spacebar)
pg_step_size: 30 # navigation step size when PgUp and PgDn key is pressed
min_object_size: 10 # minimum box/object size to be allowed (in pixels)
box_line_width: 2 # line width of bounding boxes
box_color: [0,255,0] # default box color: [b, g, r] (for boxes that have no ID)
highlight_width: 2 # line width of highlighted bounding box boundaries
cross_width: 1 # width of cross line indicating mouse position
hotkey_left: "a" # secondary hotkey for left arrow key (move backward)
hotkey_right: "d" # secondary hotkey for right arrow key (move forward)
hotkey_pgup: "q" # secondary hotkey for page up key (move backword pg_step_size)
hotkey_pgdn: "e" # secondary hotkey for page down key (move forward pg_step_size)
hotkey_shift: "s" # secondary hotkey for SHIFT key (box editing mode)
hotkey_ctrl: "w" # secondary hotkey for CTRL key (scroll mode of zoomed window)
hotkey_return: "32" # secondary hotkey for Return/Enter key (tracking)
## Export Annotation results as Video or Image List
export_video_fps: 10 # fps of output video when the input media is image list and the save type is video. If the input media is video, the origirnla fps is preserved.
export_video_codec: "XVID" # opencv fourcc codecs: "XVID", "DIVX", "MJPG", "FFV1", ... (full list of fourcc: http://www.fourcc.org/codecs.php)
export_image_format: "png" # image format when the input media is video and the save type is image list ("png", "jpg", "bmp", ...). If the input media is image list, the original format is preserved.
## User-defined GT Formats (format0 ~ format99)
# [format specifiers]
# - fn: video frame number (e.g. 0, 1, 2, ...)
# - 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: object instance id (e.g. 0, 1, 2, ...)
# - 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)
# - c=n: constant value (e.g. c=0, c=-1, c=1.23, ...). It can be used to save and load dummy values (see format2: MOT example)
# - difficult: difficult sample to train or not (it comes from pascal voc) (e.g. 0, 1)
format0: # pascal voc & imagenet (predefined format]
fixed_filetype: 1 # if specified as true, save setting isn't changeable in GUI
data_fmt: [cname, difficult, x1, y1, x2, y2]
gt_file_ext: "xml" # if not specified, default setting is used
gt_merged: 0 # if not specified, default setting is used
classes_set: "voc_classes" # if not specified, default setting is used
name: "pascal voc" # if not specified, "[fmt%d] $data_fmt" is used as default format name
format1: # darknet yolo (predefined format]
fixed_filetype: 1 # if specified as true, save setting isn't changeable in GUI
data_fmt: [classid, 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" # if not specified, "[fmt%d] $data_fmt" is used as default format name
format2: # MOT (predefined format]
fixed_filetype: 1 # if specified as true, save setting isn't changeable in GUI
data_fmt: [fn, id, x1, y1, w, h, c=-1, c=-1, c=-1, c=-1]
gt_file_ext: "csv" # if not specified, default setting is used
gt_merged: 1 # if not specified, default setting is used
classes_set: "coco_classes" # if not specified, default setting is used
name: "MOT" # if not specified, "[fmt%d] $data_fmt" is used as default format name
format3: # example of user-defined format (pascal voc & imagenet + object id)
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [cname, id, difficult, x1, y1, x2, y2]
gt_file_ext: "xml" # if not specified, default setting is used
gt_merged: 0 # if not specified, default setting is used
classes_set: "voc_classes" # if not specified, default setting is used
name: "pascal voc + id" # if not specified, "[fmt%d] $data_fmt" is used as default format name
format4: # 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
format5: # example of user-defined format (object tracking in videos)
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [fn, cname, id, x1, y1, w, h]
gt_file_ext: "txt" # initial setting (the setting can be changed in GUI)
gt_merged: 1 # initial setting (the setting can be changed in GUI)
classes_set: "my_classes1" # if not specified, default setting is used
format6: # example of user-defined format (object tracking in image sequence)
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [iname, cname, id, x1, y1, w, h]
gt_file_ext: "txt" # if not specified, default setting is used. The setting can be changed in GUI
gt_merged: 1 # if not specified, default setting is used. The setting can be changed in GUI
classes_set: "my_classes1" # if not specified, default setting is used
format7: # other example of user-defined format
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [classid, difficult, x1, y1, x2, y2]
gt_file_ext: "xml" # if not specified, default setting is used. The setting can be changed in GUI
gt_merged: 0 # if not specified, default setting is used. The setting can be changed in GUI
classes_set: "coco_classes" # if not specified, default setting is used
format8: # other example of user-defined format
fixed_filetype: 0 # if specified as true, save setting isn't changeable in GUI
data_fmt: [cname, x1, y1, w, h]
gt_file_ext: "xml" # if not specified, default setting is used. The setting can be changed in GUI
gt_merged: 0 # if not specified, default setting is used. The setting can be changed in GUI
以MOT16資料格式為例,我們可以修改添加(我們需要了解MOT16的gt是什么格式):
[fn, id, x1, y1, w, h, c=1 [0 ignore,1 activate], c=came, c=visibility ratio]
my_classes2:['person']
format9: # other example of user-defined format
fixed_filetype: 1 # if specified as true, save setting isn't changeable in GUI
data_fmt: [fn, id, x1, y1, w, h, c=1, c=cname, c=1]
gt_file_ext: "txt" # if not specified, default setting is used
gt_merged: 1 # if not specified, default setting is used
classes_set: "myclasses2" # if not specified, default setting is used
name: "MOT16" # if not specified, "[fmt%d] $data_fmt" is used as default format name
4.標注工具界面以及使用技巧
標注工具界面(選中我們自定義的標注檔案)

標注結果:
0,0,40,199,33,34,1,0,1
0,1,117,206,37,39,1,0,1
0,2,358,244,17,14,1,0,1
0,3,381,242,19,16,1,0,1
0,4,413,242,16,13,1,0,1
0,5,423,248,15,14,1,0,1
0,6,769,61,83,80,1,0,1
1,0,40,200,33,34,1,0,1
1,1,119,207,37,39,1,0,1
1,2,357,247,18,15,1,0,1
1,3,379,242,21,16,1,0,1
1,4,414,242,16,13,1,0,1
1,5,424,249,15,14,1,0,1
1,6,754,71,83,80,1,0,1
標注技巧:
1.滑鼠拖動:創建一個框;
2.Shift +右鍵單擊(特定框出現紅色線潭訓者紅色框就是被選中):僅洗掉所選框
3.Shift +右鍵單擊(空,不選擇任何,容易誤判洗掉了所有得標注框)洗掉當前螢屏上的所有框,
4.標注好一幀后,按enter鍵,會預測后結果,如果框出入比較大后,可以搭配使用2.3條,盡量不要一下子就預測了整個視頻,因為框到后面越來越偏,再進行修改會非常的麻煩,
比較全的標注檔案:視頻標注軟體Darklabel用法指南_pprp的博客-CSDN博客_darklabel安裝
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/395266.html
標籤:其他
