Remove the word Windows from the man pages

This commit is contained in:
Abdelrahman Mahmoud 2016-04-08 10:12:02 -04:00
parent 549e446f21
commit 7c66b5e7af
3 changed files with 33 additions and 33 deletions

View File

@ -1,4 +1,4 @@
#Sample Apps for Affdex C++ SDK for Windows / Linux #Sample Apps for Affdex SDK for Windows and Linux
Welcome to our repository on GitHub! Here you will find example code to get you started with our Affdex SDK 3.0 and begin emotion-enabling you own app! Documentation for the SDKs is available on the <a href=http://developer.affectiva.com/>Affectiva's Developer Portal</a>. Welcome to our repository on GitHub! Here you will find example code to get you started with our Affdex SDK 3.0 and begin emotion-enabling you own app! Documentation for the SDKs is available on the <a href=http://developer.affectiva.com/>Affectiva's Developer Portal</a>.
@ -74,7 +74,7 @@ The following command line arguments can be used to run it:
Video-demo (c++) Video-demo (c++)
---------- ----------
Project for demoing the Windows SDK [VideoDetector class](http://developer.affectiva.com/v3/windows/analyze-video/). It processs video files, displays the emotion metrics and exports the results in a csv file. Project for demoing the C++ SDK [VideoDetector class](http://developer.affectiva.com/v3/windows/analyze-video/). It processs video files, displays the emotion metrics and exports the results in a csv file.
The following command line arguments can be used to run it: The following command line arguments can be used to run it:

View File

@ -52,7 +52,7 @@ int main(int argsc, char ** argsv)
std::cerr.precision(precision); std::cerr.precision(precision);
std::cout.precision(precision); std::cout.precision(precision);
po::options_description description("Project for demoing the Windows SDK CameraDetector class (grabbing and processing frames from the camera)."); po::options_description description("Project for demoing the Affdex SDK CameraDetector class (grabbing and processing frames from the camera).");
description.add_options() description.add_options()
("help,h", po::bool_switch()->default_value(false), "Display this help message.") ("help,h", po::bool_switch()->default_value(false), "Display this help message.")
#ifdef _WIN32 #ifdef _WIN32

View File

@ -23,9 +23,9 @@ using namespace affdex;
int main(int argsc, char ** argsv) int main(int argsc, char ** argsv)
{ {
std::map<boost::filesystem::path, bool> VIDEO_EXTS = { {boost::filesystem::path(".avi"), 1}, std::map<boost::filesystem::path, bool> VIDEO_EXTS = { {boost::filesystem::path(".avi"), 1},
{boost::filesystem::path(".mov"), 1}, {boost::filesystem::path(".mov"), 1},
{boost::filesystem::path(".flv"), 1}, {boost::filesystem::path(".flv"), 1},
@ -40,13 +40,13 @@ int main(int argsc, char ** argsv)
bool loop = false; bool loop = false;
unsigned int nFaces = 1; unsigned int nFaces = 1;
int faceDetectorMode = (int)FaceDetectorMode::LARGE_FACES; int faceDetectorMode = (int)FaceDetectorMode::LARGE_FACES;
const int precision = 2; const int precision = 2;
std::cerr.precision(precision); std::cerr.precision(precision);
std::cout.precision(precision); std::cout.precision(precision);
namespace po = boost::program_options; // abbreviate namespace namespace po = boost::program_options; // abbreviate namespace
po::options_description description("Project for demoing the Windows SDK VideoDetector class (processing video files)."); po::options_description description("Project for demoing the Affdex SDK VideoDetector class (processing video files).");
description.add_options() description.add_options()
("help,h", po::bool_switch()->default_value(false), "Display this help message.") ("help,h", po::bool_switch()->default_value(false), "Display this help message.")
#ifdef _WIN32 #ifdef _WIN32
@ -81,7 +81,7 @@ int main(int argsc, char ** argsv)
std::cerr << "For help, use the -h option." << std::endl << std::endl; std::cerr << "For help, use the -h option." << std::endl << std::endl;
return 1; return 1;
} }
// Parse and check the data folder (with assets) // Parse and check the data folder (with assets)
if (!boost::filesystem::exists(DATA_FOLDER)) if (!boost::filesystem::exists(DATA_FOLDER))
{ {
@ -93,19 +93,19 @@ int main(int argsc, char ** argsv)
try try
{ {
std::shared_ptr<Detector> detector; std::shared_ptr<Detector> detector;
//Initialize out file //Initialize out file
boost::filesystem::path csvPath(videoPath); boost::filesystem::path csvPath(videoPath);
boost::filesystem::path fileExt = csvPath.extension(); boost::filesystem::path fileExt = csvPath.extension();
csvPath.replace_extension(".csv"); csvPath.replace_extension(".csv");
std::ofstream csvFileStream(csvPath.c_str()); std::ofstream csvFileStream(csvPath.c_str());
if (!csvFileStream.is_open()) if (!csvFileStream.is_open())
{ {
std::cerr << "Unable to open csv file " << csvPath << std::endl; std::cerr << "Unable to open csv file " << csvPath << std::endl;
return 1; return 1;
} }
if (VIDEO_EXTS[fileExt]) // IF it is a video file. if (VIDEO_EXTS[fileExt]) // IF it is a video file.
{ {
detector = std::make_shared<VideoDetector>(process_framerate, nFaces, (affdex::FaceDetectorMode) faceDetectorMode); detector = std::make_shared<VideoDetector>(process_framerate, nFaces, (affdex::FaceDetectorMode) faceDetectorMode);
@ -114,12 +114,12 @@ int main(int argsc, char ** argsv)
{ {
detector = std::make_shared<PhotoDetector>(nFaces, (affdex::FaceDetectorMode) faceDetectorMode); detector = std::make_shared<PhotoDetector>(nFaces, (affdex::FaceDetectorMode) faceDetectorMode);
} }
//VideoDetector videoDetector(process_framerate, nFaces, (affdex::FaceDetectorMode) faceDetectorMode); //VideoDetector videoDetector(process_framerate, nFaces, (affdex::FaceDetectorMode) faceDetectorMode);
std::cout << "Max num of faces set to: " << detector->getMaxNumberFaces() << std::endl; std::cout << "Max num of faces set to: " << detector->getMaxNumberFaces() << std::endl;
std::string mode; std::string mode;
switch (detector->getFaceDetectorMode()) switch (detector->getFaceDetectorMode())
@ -133,10 +133,10 @@ int main(int argsc, char ** argsv)
default: default:
break; break;
} }
std::cout << "Face detector mode set to: " << mode << std::endl; std::cout << "Face detector mode set to: " << mode << std::endl;
shared_ptr<PlottingImageListener> listenPtr(new PlottingImageListener(csvFileStream, draw_display)); shared_ptr<PlottingImageListener> listenPtr(new PlottingImageListener(csvFileStream, draw_display));
detector->setDetectAllEmotions(true); detector->setDetectAllEmotions(true);
detector->setDetectAllExpressions(true); detector->setDetectAllExpressions(true);
detector->setDetectAllEmojis(true); detector->setDetectAllEmojis(true);
@ -145,10 +145,10 @@ int main(int argsc, char ** argsv)
detector->setClassifierPath(DATA_FOLDER); detector->setClassifierPath(DATA_FOLDER);
detector->setLicensePath(LICENSE_PATH); detector->setLicensePath(LICENSE_PATH);
detector->setImageListener(listenPtr.get()); detector->setImageListener(listenPtr.get());
detector->start(); //Initialize the detectors .. call only once detector->start(); //Initialize the detectors .. call only once
do do
{ {
shared_ptr<StatusListener> videoListenPtr = std::make_shared<StatusListener>(); shared_ptr<StatusListener> videoListenPtr = std::make_shared<StatusListener>();
@ -161,13 +161,13 @@ int main(int argsc, char ** argsv)
{ {
//videoPath is of type std::wstring on windows, but std::string on other platforms. //videoPath is of type std::wstring on windows, but std::string on other platforms.
cv::Mat img = cv::imread(std::string(videoPath.begin(), videoPath.end())); cv::Mat img = cv::imread(std::string(videoPath.begin(), videoPath.end()));
// Create a frame // Create a frame
Frame frame(img.size().width, img.size().height, img.data, Frame::COLOR_FORMAT::BGR); Frame frame(img.size().width, img.size().height, img.data, Frame::COLOR_FORMAT::BGR);
((PhotoDetector *)detector.get())->process(frame); //Process an image ((PhotoDetector *)detector.get())->process(frame); //Process an image
} }
while (!VIDEO_EXTS[fileExt] || videoListenPtr->isRunning()) while (!VIDEO_EXTS[fileExt] || videoListenPtr->isRunning())
{ {
if (listenPtr->getDataSize() > 0) if (listenPtr->getDataSize() > 0)
@ -175,32 +175,32 @@ int main(int argsc, char ** argsv)
std::pair<Frame, std::map<FaceId, Face> > dataPoint = listenPtr->getData(); std::pair<Frame, std::map<FaceId, Face> > dataPoint = listenPtr->getData();
Frame frame = dataPoint.first; Frame frame = dataPoint.first;
std::map<FaceId, Face> faces = dataPoint.second; std::map<FaceId, Face> faces = dataPoint.second;
if (draw_display) if (draw_display)
{ {
listenPtr->draw(faces, frame); listenPtr->draw(faces, frame);
} }
std::cerr << "timestamp: " << frame.getTimestamp() std::cerr << "timestamp: " << frame.getTimestamp()
<< " cfps: " << listenPtr->getCaptureFrameRate() << " cfps: " << listenPtr->getCaptureFrameRate()
<< " pfps: " << listenPtr->getProcessingFrameRate() << " pfps: " << listenPtr->getProcessingFrameRate()
<< " faces: "<< faces.size() << endl; << " faces: "<< faces.size() << endl;
listenPtr->outputToFile(faces, frame.getTimestamp()); listenPtr->outputToFile(faces, frame.getTimestamp());
} }
} }
} while(loop); } while(loop);
detector->stop(); detector->stop();
csvFileStream.close(); csvFileStream.close();
std::cout << "Output written to file: " << csvPath << std::endl; std::cout << "Output written to file: " << csvPath << std::endl;
} }
catch (AffdexException ex) catch (AffdexException ex)
{ {
std::cerr << ex.what(); std::cerr << ex.what();
} }
return 0; return 0;
} }