Skip to content

Commit

Permalink
Added a version (1.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
severin-lemaignan committed Feb 28, 2017
1 parent 49a759f commit 768e67e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
project(gazr)

add_definitions(-std=c++11)
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})

add_definitions(-std=c++11 -DGAZR_VERSION=${VERSION})

find_package(dlib REQUIRED)
include_directories(${dlib_INCLUDE_DIRS})
Expand Down
7 changes: 5 additions & 2 deletions tools/benchmark_head_pose_estimation_single_frame.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define STR_EXPAND(tok) #tok
#define STR(tok) STR_EXPAND(tok)

#ifdef OPENCV3
#include <opencv2/imgcodecs.hpp>
#else
Expand All @@ -18,8 +21,8 @@ int main(int argc, char **argv)
Mat frame;

if(argc < 3) {
cerr << "Usage: " << endl <<
"head_pose model.dat frame.{jpg|png}" << endl;
cerr << argv[0] << " " << STR(GAZR_VERSION) << "\n\nUsage: "
<< endl << argv[0] << " model.dat frame.{jpg|png}" << endl;
#ifdef HEAD_POSE_ESTIMATION_DEBUG
cerr << "Output: a new frame 'head_pose_<frame>.png'" << endl;
#endif
Expand Down
11 changes: 10 additions & 1 deletion tools/estimate_head_direction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

#include "../src/head_pose_estimation.hpp"

#define STR_EXPAND(tok) #tok
#define STR(tok) STR_EXPAND(tok)

using namespace std;
using namespace cv;
namespace po = boost::program_options;
Expand All @@ -30,6 +33,7 @@ int main(int argc, char **argv)
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("version,v", "shows version and exits")
("show,s", "display the image with gaze estimation")
("model", po::value<string>(), "dlib's trained face model")
("image", po::value<string>(), "image to process (png, jpg)")
Expand All @@ -43,10 +47,15 @@ int main(int argc, char **argv)
po::notify(vm);

if (vm.count("help")) {
cout << "estimate_gaze_direction\n\n" << desc << "\n";
cout << argv[0] << " " << STR(GAZR_VERSION) << "\n\n" << desc << "\n";
return 1;
}

if (vm.count("version")) {
cout << argv[0] << " " << STR(GAZR_VERSION) << "\n";
return 0;
}

if (vm.count("show")) {
show_frame = true;
}
Expand Down
13 changes: 11 additions & 2 deletions tools/show_head_pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

#include "../src/head_pose_estimation.hpp"

#define STR_EXPAND(tok) #tok
#define STR(tok) STR_EXPAND(tok)

using namespace std;
using namespace cv;
namespace po = boost::program_options;
Expand All @@ -27,7 +30,8 @@ int main(int argc, char **argv)

po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("help,h", "produces help message")
("version,v", "shows version and exits")
("model", po::value<string>(), "dlib's trained face model")
("video", po::value<string>(), "video to process. If omitted, uses the first webcam")
;
Expand All @@ -40,10 +44,15 @@ int main(int argc, char **argv)
po::notify(vm);

if (vm.count("help")) {
cout << "estimate_gaze_direction\n\n" << desc << "\n";
cout << argv[0] << " " << STR(GAZR_VERSION) << "\n\n" << desc << "\n";
return 1;
}

if (vm.count("version")) {
cout << argv[0] << " " << STR(GAZR_VERSION) << "\n";
return 0;
}

if (vm.count("model") == 0) {
cout << "You must specify the path to a trained dlib's face model\n"
<< "with the option --model." << endl;
Expand Down

0 comments on commit 768e67e

Please sign in to comment.