mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
clarified examples
This commit is contained in:
parent
2cb5177f73
commit
e66fa51ebe
@ -7,7 +7,7 @@
|
|||||||
human face.
|
human face.
|
||||||
|
|
||||||
The examples/faces folder contains some jpg images of people. You can run
|
The examples/faces folder contains some jpg images of people. You can run
|
||||||
this program on them and see the detections by executing the following:
|
this program on them and see the detections by executing the following command:
|
||||||
./face_detection_ex faces/*.jpg
|
./face_detection_ex faces/*.jpg
|
||||||
|
|
||||||
|
|
||||||
@ -17,8 +17,8 @@
|
|||||||
general and capable of detecting many types of semi-rigid objects in
|
general and capable of detecting many types of semi-rigid objects in
|
||||||
addition to human faces. Therefore, if you are interested in making your
|
addition to human faces. Therefore, if you are interested in making your
|
||||||
own object detectors then read the fhog_object_detector_ex.cpp example
|
own object detectors then read the fhog_object_detector_ex.cpp example
|
||||||
program. It shows how to use the machine learning tools used to create this
|
program. It shows how to use the machine learning tools which were used to
|
||||||
face detector.
|
create dlib's face detector.
|
||||||
|
|
||||||
|
|
||||||
Finally, note that the face detector is fastest when compiled with at least
|
Finally, note that the face detector is fastest when compiled with at least
|
||||||
@ -26,9 +26,9 @@
|
|||||||
chip then you should enable at least SSE2 instructions. If you are using
|
chip then you should enable at least SSE2 instructions. If you are using
|
||||||
cmake to compile this program you can enable them by using one of the
|
cmake to compile this program you can enable them by using one of the
|
||||||
following commands when you create the build project:
|
following commands when you create the build project:
|
||||||
cmake path_to_dclib/examples -DUSE_SSE2_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_SSE2_INSTRUCTIONS=ON
|
||||||
cmake path_to_dclib/examples -DUSE_SSE4_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_SSE4_INSTRUCTIONS=ON
|
||||||
cmake path_to_dclib/examples -DUSE_AVX_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_AVX_INSTRUCTIONS=ON
|
||||||
This will set the appropriate compiler options for GCC, clang, Visual
|
This will set the appropriate compiler options for GCC, clang, Visual
|
||||||
Studio, or the Intel compiler. If you are using another compiler then you
|
Studio, or the Intel compiler. If you are using another compiler then you
|
||||||
need to consult your compiler's manual to determine how to enable these
|
need to consult your compiler's manual to determine how to enable these
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
then you should enable at least SSE2 instructions. If you are using cmake
|
then you should enable at least SSE2 instructions. If you are using cmake
|
||||||
to compile this program you can enable them by using one of the following
|
to compile this program you can enable them by using one of the following
|
||||||
commands when you create the build project:
|
commands when you create the build project:
|
||||||
cmake path_to_dclib/examples -DUSE_SSE2_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_SSE2_INSTRUCTIONS=ON
|
||||||
cmake path_to_dclib/examples -DUSE_SSE4_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_SSE4_INSTRUCTIONS=ON
|
||||||
cmake path_to_dclib/examples -DUSE_AVX_INSTRUCTIONS=ON
|
cmake path_to_dlib_root/examples -DUSE_AVX_INSTRUCTIONS=ON
|
||||||
This will set the appropriate compiler options for GCC, clang, Visual
|
This will set the appropriate compiler options for GCC, clang, Visual
|
||||||
Studio, or the Intel compiler. If you are using another compiler then you
|
Studio, or the Intel compiler. If you are using another compiler then you
|
||||||
need to consult your compiler's manual to determine how to enable these
|
need to consult your compiler's manual to determine how to enable these
|
||||||
@ -44,14 +44,14 @@ int main(int argc, char** argv)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// In this example we are going to train a face detector based on the
|
// In this example we are going to train a face detector based on the
|
||||||
// small faces dataset in the dclib/examples/faces directory. So the
|
// small faces dataset in the examples/faces directory. So the first
|
||||||
// first thing we do is load that dataset. This means you need to
|
// thing we do is load that dataset. This means you need to supply the
|
||||||
// supply the path to this faces folder as a command line argument so we
|
// path to this faces folder as a command line argument so we will know
|
||||||
// will know where it is.
|
// where it is.
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
cout << "Give the path to the dclib/examples/faces directory as the argument to this" << endl;
|
cout << "Give the path to the examples/faces directory as the argument to this" << endl;
|
||||||
cout << "program. For example, if you are in the dclib/examples folder then execute " << endl;
|
cout << "program. For example, if you are in the examples folder then execute " << endl;
|
||||||
cout << "this program by running: " << endl;
|
cout << "this program by running: " << endl;
|
||||||
cout << " ./fhog_object_detector_ex faces" << endl;
|
cout << " ./fhog_object_detector_ex faces" << endl;
|
||||||
cout << endl;
|
cout << endl;
|
||||||
@ -84,10 +84,10 @@ int main(int argc, char** argv)
|
|||||||
// the data into images_train and face_boxes_train. But for convenience
|
// the data into images_train and face_boxes_train. But for convenience
|
||||||
// dlib comes with tools for creating and loading XML image dataset
|
// dlib comes with tools for creating and loading XML image dataset
|
||||||
// files. Here you see how to load the data. To create the XML files
|
// files. Here you see how to load the data. To create the XML files
|
||||||
// you can use the imglab tool which can be found in the
|
// you can use the imglab tool which can be found in the tools/imglab
|
||||||
// dclib/tools/imglab folder. It is a simple graphical tool for
|
// folder. It is a simple graphical tool for labeling objects in images
|
||||||
// labeling objects in images with boxes. To see how to use it read the
|
// with boxes. To see how to use it read the tools/imglab/README.txt
|
||||||
// dclib/tools/imglab/README.txt file.
|
// file.
|
||||||
load_image_dataset(images_train, face_boxes_train, faces_directory+"/training.xml");
|
load_image_dataset(images_train, face_boxes_train, faces_directory+"/training.xml");
|
||||||
load_image_dataset(images_test, face_boxes_test, faces_directory+"/testing.xml");
|
load_image_dataset(images_test, face_boxes_test, faces_directory+"/testing.xml");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user