RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
face_detect.cpp
Go to the documentation of this file.
7 int main(int argc, char* argv[])
8 {
9  if (argc == 3) {
10  std::cout << "face detect: " << argv[1] << std::endl;
11  std::string file = argv[1];
12  std::string token = argv[2];
13 
14  // service controler
16 
17  // load the image from argv[1]
18  if (auto pic = std::make_shared<rapp::object::picture>(file)) {
19  auto callback = [&](std::vector<rapp::object::face> faces)
20  {std::cout << "found " << faces.size() << " faces!" << std::endl;};
21 
22  auto fdetect = std::make_shared<rapp::cloud::face_detection>(pic, false, token, callback);
23  if (fdetect) {
24  ctrl.run_job(fdetect);
25  }
26  }
27  else {
28  std::cerr << "Error loading image: " << argv[1] << std::endl;
29  }
30  return 0;
31  }
32 }
Main class that controllers RAPP Services.
int main(int argc, char *argv[])
Definition: face_detect.cpp:7
void run_job(const std::shared_ptr< asio_socket > job)
Run one service job.