Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
1d3b429f
"vscode:/vscode.git/clone" did not exist on "47b719bb4171dcfc263818f3218a041f32a3c310"
Commit
1d3b429f
authored
Mar 22, 2012
by
Davis King
Browse files
improved comments
parent
ae8e1b5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
examples/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
also
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