Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
1d3b429f
Commit
1d3b429f
authored
Mar 22, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved comments
parent
ae8e1b5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
train_object_detector.cpp
examples/train_object_detector.cpp
+12
-13
No files found.
examples/train_object_detector.cpp
View file @
1d3b429f
...
...
@@ -2,7 +2,7 @@
/*
This is an example showing how you might use dlib to create a reasonably
function command line tool for object detection. This example assumes
function
al
command line tool for object detection. This example assumes
you are familiar with the contents of at least the following example
programs:
- object_detector_ex.cpp
...
...
@@ -13,17 +13,15 @@
This program is a command line tool for learning to detect objects in images.
Therefore, to create an object detector it requires a set of annotated training
images. To create this annotated data you will need to compile the imglab tool
included with dlib. To do this, go to the tools/imglab folder and type the
following:
images. To create this annotated data you will need to use the imglab tool
included with dlib. It is located in the tools/imglab folder and can be compiled
using the following commands.
cd tools/imglab
mkdir build
cd build
cmake ..
make
Note that you may need to install CMake (www.cmake.org) for this to work. Also,
if you are using visual studio then you should use the following command to
compile instead of "make"
cmake --build . --config Release
Note that you may need to install CMake (www.cmake.org) for this to work.
Next, lets assume you have a folder of images called /tmp/images. These images
should contain examples of the objects you want to learn to detect. You will
...
...
@@ -39,13 +37,14 @@
with boxes. Note that it is important to label all the objects since any object
not labeled is implicitly assumed to be not an object we should detect.
Once you finish labeling objects go to the file menu, click save, and
close the
program. This will save the object boxes back to mydataset.xml. You can verify
Once you finish labeling objects go to the file menu, click save, and
then close
the
program. This will save the object boxes back to mydataset.xml. You can verify
this by opening the tool again with
./imglab mydataset.xml
and observing that the boxes are present.
Returning to the present example program, we can now issue the command
Returning to the present example program, we can compile it using cmake just as we
did with the imglab tool. Once compiled, we can issue the command
./train_object_detector -tv mydataset.xml
which will train an object detection model based on our labeled data. The model
will be saved to the file object_detector.svm. Once this has finished we can use
...
...
@@ -55,8 +54,8 @@
be indicated by a red box.
There are a
lso a number of other useful command line options in the current
example
program which you can explore below.
There are a
number of other useful command line options in the current example
program which you can explore below.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment