SSD Demo details how to use SSDs for object detection training and validation on VOC data sets.
This article describes how to use SSDs to implement the training and validation process for your own datasets, including the following:
1 Labeling of datasets
2 Conversion of datasets
3 How to train with SSDs
4 How to test using SSDs
1 Labeling of datasets
Data annotations Use the Bbox-label-tool tool, which is implemented using Python and is simple and easy to use. The modified tool supports multi-label label labeling.
The label format generated by the tool is:
Object_number
ClassName x1min y1min X1max Y1max
ClassName X2min y2min X2max Y2max
...
Instructions for using the 1.1 Labeltool tool
Bbox-label-tool tool implementation is simple, the original git version of the use of a few minor problems, made a simple modification, modified version
#-------------------------------------------------------------------------------# name:object bounding box label Tool # Purpose:label Object bboxes for ImageNet Detection data # Author:qiushi # created:06/06/2014 # #-- -----------------------------------------------------------------------------from __future__ Import Division from Tkinter Import * Import Tkmessagebox from PIL import Image, imagetk import OS import glob import random # colors for the
Bboxes COLORS = [' Red ', ' blue ', ' yellow ', ' pink ', ' cyan ', ' green ', ' black '] # image sizes for the examples SIZE = 256, 256 Classlabels=[' mat ', ' door ', ' sofa ', ' chair ', ' table ', ' bed ', ' ashcan ', ' shoe '] class Labeltool (): Def __init__ (self , master): # Set up the main frame self.parent = Master Self.parent.title ("Labeltool") sel F.frame = FRAME (self.parent) self.frame.pack (Fill=both, expand=1) self.parent.resizable (width = False, hei Ght = False) # Initialize global state Self.imagedir = ' self.imagelist= [] self.egdir = ' self.eglist = []
Self.outdir = ' Self.cur = 0 self.total = 0 self.category = 0 self.imagename = ' Self.labelfilename = ' self.tkimg = None # Initialize mouse state self. state = {} self. state[' click ' = 0 self. state[' x '], self. state[' y '] = 0, 0 # Reference to Bbox self.bboxidlist = [] Self.bboxid = None self.bboxli st = [] Self.hl = None Self.vl = None Self.currentclass = "#-----------------GUI stuf
F---------------------# dir entry & Load Self.label = label (self.frame, Text = "Image dir:") Self.label.grid (row = 0, column = 0, sticky = E) Self.entry = entry (self.frame) self.entry.grid (row = 0, Column = 1, sticky = w+e) self.ldbtn = button (self.frame, Text = "Load", command =Self.loaddir) self.ldBtn.grid (row = 0, column = 2, sticky = w+e) # main panel for labeling SELF.M Ainpanel = Canvas (self.frame, cursor= ' Tcross ') self.mainPanel.bind ("<Button-1>", Self.mouseclick) se Lf.mainPanel.bind ("<Motion>", Self.mousemove) self.parent.bind ("<Escape>", Self.cancelbbox) # Press & Lt espace> to cancel current bbox Self.parent.bind ("s", Self.cancelbbox) Self.parent.bind ("A", Self.previm Age) # Press ' A ' to go backforward self.parent.bind ("D", Self.nextimage) # press ' d ' to go forward self.ma Inpanel.grid (row = 1, column = 1, rowspan = 4, sticky = w+n) # showing bbox info & Delete Bbox self.l B1 = Label (self.frame, Text = ' bounding boxes: ') self.lb1.grid (row = 1, column = 2, sticky = w+n) self.li Stbox = Listbox (self.frame, Width = $, height = N) self.listbox.grid (row = 2, column = 2, sticky = nth) se Lf.btndel = Button (SELf.frame, Text = ' Delete ', command = Self.delbbox) self.btnDel.grid (row = 3, column = 2, sticky = w+e+n) s Elf.btnclear = Button (self.frame, Text = ' ClearAll ', command = Self.clearbbox) self.btnClear.grid (row = 4, column = 2, sticky = w+e+n) #select class type Self.classpanel = Frame (self.frame) Self.classpan
El.grid (row = 5, column = 1, ColumnSpan = ten, sticky = w+e) label = label (self.classpanel, Text = ' class: ') Label.grid (row = 5, column = 1, sticky = w+n) Self.classbox = Listbox (self.classpanel, Width = 4, Heig HT = 2) self.classbox.grid (row = 5,column = 2) for each in range (len (classlabels)): function = ' SELECT ' + classlabels[each] Print Classlabels[each] Btnmat = Button (self.classpanel, Text = Clas Slabels[each], command = getattr (self, Function)) btnmat.grid (row = 5, column = each + 3) # C Ontrol Panel for Image NAvigation Self.ctrpanel = Frame (self.frame) self.ctrPanel.grid (row = 6, column = 1, ColumnSpan = 2, sticky = w+e) self.prevbtn = Button (Self.ctrpanel, text= ' << Prev ', width = ten, command = self.previmage) s Elf.prevBtn.pack (side = left, PADX = 5, Pady = 3) self.nextbtn = Button (Self.ctrpanel, text= ' Next >> ', width = ten, command = self.nextimage) Self.nextBtn.pack (side = left, PADX = 5, Pady = 3) Self.proglabel = Label (Self.ctrpanel, Text = "Progress:/") self.progLabel.pack (side = left, PADX = 5) Self.tmplabel = L
Abel (self.ctrpanel, Text = "Go to Image No.") Self.tmpLabel.pack (side = left, PADX = 5) Self.idxentry = Entry (self.ctrpanel, Width = 5) SELF.IDXENTRY.PA CK (side = left) Self.gobtn = Button (self.ctrpanel, Text = ' Go ', command = self.gotoimage) Self.goBtn.pack (
Side = left)