3DiVi Face SDK  3.24.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups
FacerecService.h
1 
9 #ifndef __PBIO_API__PBIO__FACEREC_SERVICE_H_
10 #define __PBIO_API__PBIO__FACEREC_SERVICE_H_
11 
12 
13 #include <istream>
14 #include <stdexcept>
15 #include <utility>
16 #include <vector>
17 #include <facerec/libfacerec.h>
18 
19 #ifdef ANDROID
20 #include <jni.h>
21 #endif
22 
23 #include "stl_wraps_impls/WrapIStreamImpl.h"
24 #include "stl_wraps_impls/WrapOStreamImpl.h"
25 
26 
27 #include "AgeGenderEstimator.h"
28 #include "CameraCalibrator.h"
29 #include "Capturer.h"
30 #include "ComplexObject.h"
31 #include "DepthLivenessEstimator.h"
32 #include "IRLivenessEstimator.h"
33 #include "ActiveLiveness.h"
34 #include "Liveness2DEstimator.h"
36 #include "EmotionsEstimator.h"
37 #include "Error.h"
38 #include "ExceptionCheck.h"
39 #include "FaceQualityEstimator.h"
40 #include "LivenessEstimator.h"
41 #include "QualityEstimator.h"
42 #include "RawSample.h"
43 #include "Recognizer.h"
44 #include "SmartPtr.h"
45 #include "Template.h"
46 #include "VideoWorker.h"
47 #include "StructStorage.h"
48 #include "Config.h"
49 #include "ProcessingUnit.h"
50 
51 #ifndef WITHOUT_PROCESSING_BLOCK
52 #include "Context.h"
53 #include "ProcessingBlock.h"
54 #endif
55 
56 namespace pbio
57 {
58 
64 class FacerecService : ComplexObject
65 {
66 public:
67 
73  typedef LightSmartPtr<FacerecService>::tPtr Ptr;
74 
75  typedef pbio::Config Config;
76 
81  struct License
82  {
87  const std::string license_body;
88 
89  License(std::string license_body) : license_body(license_body) { }
90  };
91 
97  struct LicenseState
98  {
104  {
109  std::string name;
110 
115  int64_t max_value;
116 
121  int64_t value;
122  };
123 
128  bool online;
129 
130 
135  std::string android_app_id;
136 
141  std::string android_serial;
142 
147  std::string ios_app_id;
148 
153  std::string hardware_reg;
154 
159  std::vector<CounterState> counters;
160  };
161 
200  const std::string dll_path,
201  std::string facerec_conf_dir,
202  const std::string license_dir = std::string());
203 
238  const std::string dll_path,
239  std::string facerec_conf_dir,
240  const pbio::FacerecService::License license);
241 
243 
244  // internal usage only
246  void* const ae_ptr,
247  const std::string dll_path,
248  std::string facerec_conf_dir,
249  const std::string license,
250  const bool is_license_dir);
251 
253 
254 
272  std::string getVersion() const;
273 
283  void forceOnlineLicenseUpdate() const;
284 
311 
335  AgeGenderEstimator::Ptr createAgeGenderEstimator(const std::string ini_file) const;
336 
360  QualityEstimator::Ptr createQualityEstimator(const std::string ini_file) const;
361 
385  FaceQualityEstimator::Ptr createFaceQualityEstimator(const std::string ini_file) const;
386 
405 
429  EmotionsEstimator::Ptr createEmotionsEstimator(const std::string ini_file) const;
430 
475  const char* ini_file,
476  const bool processing = true,
477  const bool matching = true,
478  const bool processing_less_memory_consumption = false) const;
479 
480 
481  Recognizer::Ptr createResizableRecognizer(
482  const char* ini_file,
483  const bool processing = true,
484  const bool matching = true,
485  const bool processing_less_memory_consumption = false) const;
486 
487 
532  const pbio::FacerecService::Config recognizer_config,
533  const bool processing = true,
534  const bool matching = true,
535  const bool processing_less_memory_consumption = false) const;
536 
569  const pbio::VideoWorker::Params params) const;
570 
571 
614  const pbio::FacerecService::Config video_worker_config,
615  const char* recognizer_ini_file,
616  const int streams_count,
617  const int processing_threads_count,
618  const int matching_threads_count) const;
619 
620 
663  const pbio::FacerecService::Config video_worker_config,
664  const pbio::FacerecService::Config recognizer_config,
665  const int streams_count,
666  const int processing_threads_count,
667  const int matching_threads_count) const;
668 
669 
670 
698  RawSample::Ptr loadRawSample(std::istream &binary_stream) const;
699 
727  RawSample::Ptr loadRawSample(pbio::stl_wraps::WrapIStream &binary_stream) const;
728 
729 
793  pbio::stl_wraps::WrapIStream &binary_stream,
794  const RawImage image,
795  const double space_translation_x = 0,
796  const double space_translation_y = 0,
797  const double space_scale = 1) const;
798 
803  std::istream &binary_stream,
804  const RawImage image,
805  const double space_translation_x = 0,
806  const double space_translation_y = 0,
807  const double space_scale = 1) const;
808 
863  pbio::stl_wraps::WrapIStream &binary_stream,
864  const unsigned char *image_data,
865  int image_data_size,
866  const double space_translation_x = 0,
867  const double space_translation_y = 0,
868  const double space_scale = 1) const;
869 
875  std::istream &binary_stream,
876  const unsigned char *image_data,
877  int image_data_size,
878  const double space_translation_x = 0,
879  const double space_translation_y = 0,
880  const double space_scale = 1) const;
881 
882 
901 
902 
927  const std::string ini_file) const;
928 
929 
954  const pbio::FacerecService::Config config) const;
955 
956 
981  const std::string ini_file) const;
982 
983 
1008  const pbio::FacerecService::Config config) const;
1009 
1010 
1035  const std::string ini_file) const;
1036 
1037 
1062  const pbio::FacerecService::Config config) const;
1063 
1088  const std::string ini_file) const;
1089 
1091 
1092  ProcessingUnit::Ptr createProcessingUnit(
1093  const int block_type,
1094  const char* serializedConfig) const;
1095 
1096 #ifndef WITHOUT_PROCESSING_BLOCK
1097 
1105  Context createContext() const;
1106 
1119  Context createContextFromEncodedImage(const uint8_t* data, uint64_t dataSize) const;
1120 
1131  Context createContextFromEncodedImage(const std::vector<uint8_t>& data) const;
1132 
1143  Context createContextFromEncodedImage(const std::string& data) const;
1144 
1145  Context createContextFromEncodedImage(const std::vector<char>& data) const;
1146 
1165  Context createContextFromFrame(uint8_t* data, int32_t width, int32_t height, Context::Format format = Context::Format::FORMAT_BGR, int32_t baseAngle = 0) const;
1166 
1167  Context createContextFromJsonFile(const char* path);
1168 
1179  Context createContextFromJsonFile(std::string path);
1180 
1191  ProcessingBlock createProcessingBlock(const Context& config) const;
1192 #endif
1193 
1195 
1213  LicenseState getLicenseState() const;
1214 
1215 
1229  void keepAlgorithmsCache() const;
1230 
1242  void freeAlgorithmsCache() const;
1243 
1244 
1285  const int width,
1286  const int height,
1287  const RawImage::Format format);
1288 
1289 
1290 #ifdef ANDROID
1291 
1331  JNIEnv *env,
1332  jobject android_media_image);
1333 #endif // ifdef ANDROID
1334 
1335 
1376  void convertYUV2ARGB(
1377  const RawImage image,
1378  const bool downscale_x2,
1379  void* const result_buffer);
1380 
1381 
1382  void convertYUV2RGB(
1383  const RawImage image,
1384  const bool downscale_x2,
1385  const int base_angle,
1386  void* const result_buffer);
1387 
1388 
1389  void convertBGRA88882RGB(
1390  const RawImage image,
1391  const bool downscale_x2,
1392  const int base_angle,
1393  void* const result_buffer);
1394 
1395 
1396 private:
1397 
1398  const std::string _facerec_conf_dir;
1399 
1400  friend class object_with_ref_counter<FacerecService>;
1401 protected:
1403  const DHPtr &dll_handle,
1404  const std::string &facerec_conf_dir,
1405  void* impl);
1406 };
1407 
1408 } // pbio namespace
1409 
1410 
1411 
1412 
1416 
1417 
1418 namespace pbio
1419 {
1420 
1421 
1422 // static
1423 inline
1425  const std::string dll_path,
1426  std::string facerec_conf_dir,
1427  const std::string license_dir)
1428 {
1429  return createService(NULL, dll_path, facerec_conf_dir, license_dir, true);
1430 }
1431 
1432 // static
1433 inline
1435  const std::string dll_path,
1436  std::string facerec_conf_dir,
1437  const pbio::FacerecService::License license)
1438 {
1439  return createService(NULL, dll_path, facerec_conf_dir, license.license_body, false);
1440 }
1441 
1442 // static
1443 inline
1445  void* const ae_ptr,
1446  const std::string dll_path,
1447  std::string facerec_conf_dir,
1448  const std::string license,
1449  const bool is_license_dir)
1450 {
1451 
1452 #ifdef __STATIC_LIBFACEREC_BUILD__
1453  (void) dll_path;
1454 
1455  const DHPtr dll_handle( DHPtr::make() );
1456 #else
1457  const DHPtr dll_handle( DHPtr::make(dll_path.c_str()) );
1458 #endif
1459 
1460  if(facerec_conf_dir.empty())
1461  {
1462  facerec_conf_dir = "./";
1463  }
1464  else if(facerec_conf_dir[facerec_conf_dir.length() - 1] != '/')
1465  {
1466  facerec_conf_dir += '/';
1467  }
1468 
1469  void* exception = NULL;
1470 
1471  void* the_impl;
1472 
1473  if (is_license_dir)
1474  {
1475  the_impl = dll_handle->FacerecService_constructor3(
1476  ae_ptr,
1477  facerec_conf_dir.c_str(),
1478  license.empty() ?
1479  NULL :
1480  license.c_str(),
1481  dll_path.c_str(),
1482  &exception);
1483  }else
1484  {
1485  the_impl = dll_handle->FacerecService_constructor5(
1486  ae_ptr,
1487  facerec_conf_dir.c_str(),
1488  license.c_str(),
1489  dll_path.c_str(),
1490  &exception);
1491  }
1492 
1493  checkException(exception, *dll_handle);
1494 
1495  return FacerecService::Ptr::make(
1496  dll_handle,
1497  facerec_conf_dir,
1498  the_impl);
1499 }
1500 
1501 
1502 inline
1503 FacerecService::FacerecService(
1504  const DHPtr &dll_handle,
1505  const std::string &facerec_conf_dir,
1506  void* impl):
1507 ComplexObject(dll_handle, impl),
1508 _facerec_conf_dir(facerec_conf_dir)
1509 {
1510  std::string lib_version = getVersion();
1511 
1512  if (LIBFACEREC_VERSION != lib_version)
1513  std::cerr << "WARNING: The version in the header does not match the version in the library. Header version: "
1514  << LIBFACEREC_VERSION << ", library version: " << lib_version << std::endl;
1515 }
1516 
1517 
1518 inline
1519 std::string FacerecService::getVersion() const
1520 {
1521  std::ostringstream version_stream;
1522  pbio::stl_wraps::WrapOStreamImpl version_stream_wrap(version_stream);
1523 
1524  void* exception = NULL;
1525 
1526  _dll_handle->get_version(
1527  &version_stream_wrap,
1528  pbio::stl_wraps::WrapOStream::write_func,
1529  &exception);
1530 
1531  checkException(exception, *_dll_handle);
1532 
1533  return version_stream.str();
1534 }
1535 
1536 
1537 inline
1539 {
1540  void* exception = NULL;
1541 
1542  _dll_handle->FacerecService_forceOnlineLicenseUpdate(
1543  _impl,
1544  &exception);
1545 
1546  checkException(exception, *_dll_handle);
1547 }
1548 
1549 inline
1551  const pbio::FacerecService::Config config) const
1552 {
1553  const std::string file_path = _facerec_conf_dir + config.config_filepath;
1554 
1555  std::vector<char const*> overridden_keys;
1556  std::vector<double> overridden_values;
1557 
1558  config.prepare(overridden_keys, overridden_values);
1559 
1560  void* exception = NULL;
1561 
1562  pbio::facerec::CapturerImpl* const capturer_impl =
1563  _dll_handle->FacerecService_createCapturerE(
1564  _impl,
1565  file_path.c_str(),
1566  overridden_keys.size(),
1567  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1568  overridden_values.empty() ? NULL : &(overridden_values[0]),
1569  &exception);
1570 
1571  checkException(exception, *_dll_handle);
1572 
1573  return Capturer::Ptr::make(_dll_handle, capturer_impl);
1574 }
1575 
1576 inline
1578 {
1579  const std::string file_path = _facerec_conf_dir + ini_file;
1580 
1581  void* exception = NULL;
1582 
1583  pbio::facerec::AgeGenderEstimatorImpl* const the_impl =
1584  _dll_handle->FacerecService_createAgeGenderEstimator(
1585  _impl,
1586  file_path.c_str(),
1587  &exception);
1588 
1589  checkException(exception, *_dll_handle);
1590 
1591  return AgeGenderEstimator::Ptr::make(_dll_handle, the_impl);
1592 }
1593 
1594 
1595 inline
1597 {
1598  const std::string file_path = _facerec_conf_dir + ini_file;
1599 
1600  void* exception = NULL;
1601 
1602  pbio::facerec::QualityEstimatorImpl* const the_impl =
1603  _dll_handle->FacerecService_createQualityEstimator(
1604  _impl,
1605  file_path.c_str(),
1606  &exception);
1607 
1608  checkException(exception, *_dll_handle);
1609 
1610  return QualityEstimator::Ptr::make(_dll_handle, the_impl);
1611 }
1612 
1613 
1614 inline
1616 {
1617  const std::string file_path = _facerec_conf_dir + ini_file;
1618 
1619  void* exception = NULL;
1620 
1621  pbio::facerec::FaceQualityEstimatorImpl* const the_impl =
1622  _dll_handle->FacerecService_createFaceQualityEstimator(
1623  _impl,
1624  file_path.c_str(),
1625  &exception);
1626 
1627  checkException(exception, *_dll_handle);
1628 
1629  return FaceQualityEstimator::Ptr::make(_dll_handle, the_impl);
1630 }
1631 
1632 inline
1634 {
1635  void* exception = NULL;
1636 
1637  pbio::facerec::LivenessEstimatorImpl* const the_impl =
1638  _dll_handle->FacerecService_createLivenessEstimator(
1639  _impl,
1640  &exception);
1641 
1642  checkException(exception, *_dll_handle);
1643 
1644  return LivenessEstimator::Ptr::make(_dll_handle, the_impl);
1645 }
1646 
1647 
1648 inline
1650  const std::string ini_file) const
1651 {
1652  const std::string file_path = _facerec_conf_dir + ini_file;
1653 
1654  void* exception = NULL;
1655 
1656  pbio::facerec::EmotionsEstimatorImpl* const the_impl =
1657  _dll_handle->FacerecService_createEmotionsEstimator(
1658  _impl,
1659  file_path.c_str(),
1660  &exception);
1661 
1662  checkException(exception, *_dll_handle);
1663 
1664  return EmotionsEstimator::Ptr::make(_dll_handle, the_impl);
1665 }
1666 
1667 
1668 inline
1670  const char* ini_file,
1671  const bool processing,
1672  const bool matching,
1673  const bool processing_less_memory_consumption) const
1674 {
1675  const std::string file_path = _facerec_conf_dir + ini_file;
1676 
1677  void* exception = NULL;
1678 
1679  pbio::facerec::RecognizerImpl* const recognizer_impl =
1680  _dll_handle->FacerecService_createRecognizer2(
1681  _impl,
1682  file_path.c_str(),
1683  0,
1684  NULL,
1685  NULL,
1686  (int) processing,
1687  (int) matching,
1688  (int) processing_less_memory_consumption,
1689  &exception);
1690 
1691  checkException(exception, *_dll_handle);
1692 
1693  return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1694 }
1695 
1696 
1697 inline
1698 Recognizer::Ptr FacerecService::createResizableRecognizer(
1699  const char* ini_file,
1700  const bool processing,
1701  const bool matching,
1702  const bool processing_less_memory_consumption) const
1703 {
1704  const std::string file_path = _facerec_conf_dir + ini_file;
1705 
1706  void* exception = NULL;
1707 
1708  pbio::facerec::RecognizerImpl* const recognizer_impl =
1709  _dll_handle->FacerecService_createResizableRecognizer2(
1710  _impl,
1711  file_path.c_str(),
1712  0,
1713  NULL,
1714  NULL,
1715  (int) processing,
1716  (int) matching,
1717  (int) processing_less_memory_consumption,
1718  &exception);
1719 
1720  checkException(exception, *_dll_handle);
1721 
1722  return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1723 }
1724 
1725 
1726 inline
1728  const pbio::FacerecService::Config recognizer_config,
1729  const bool processing,
1730  const bool matching,
1731  const bool processing_less_memory_consumption) const
1732 {
1733  const std::string file_path = _facerec_conf_dir + recognizer_config.config_filepath;
1734 
1735  std::vector<char const*> overridden_keys;
1736  std::vector<double> overridden_values;
1737 
1738  recognizer_config.prepare(overridden_keys, overridden_values);
1739 
1740  void* exception = NULL;
1741 
1742  pbio::facerec::RecognizerImpl* const recognizer_impl =
1743  _dll_handle->FacerecService_createRecognizer2(
1744  _impl,
1745  file_path.c_str(),
1746  overridden_keys.size(),
1747  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1748  overridden_values.empty() ? NULL : &(overridden_values[0]),
1749  (int) processing,
1750  (int) matching,
1751  (int) processing_less_memory_consumption,
1752  &exception);
1753 
1754  checkException(exception, *_dll_handle);
1755 
1756  return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1757 }
1758 
1759 
1760 
1761 inline
1763  const pbio::FacerecService::Config video_worker_ini_file,
1764  const char* recognizer_ini_file,
1765  const int streams_count,
1766  const int processing_threads_count,
1767  const int matching_threads_count) const
1768 {
1769  return createVideoWorker(
1771  .video_worker_config(video_worker_ini_file)
1772  .recognizer_ini_file(recognizer_ini_file)
1773  .streams_count(streams_count)
1774  .processing_threads_count(processing_threads_count)
1775  .matching_threads_count(matching_threads_count)
1776  );
1777 }
1778 
1779 inline
1781  const pbio::FacerecService::Config video_worker_ini_file,
1782  const pbio::FacerecService::Config recognizer_config,
1783  const int streams_count,
1784  const int processing_threads_count,
1785  const int matching_threads_count) const
1786 {
1787  return createVideoWorker(
1789  .video_worker_config(video_worker_ini_file)
1790  .recognizer_config(recognizer_config)
1791  .streams_count(streams_count)
1792  .processing_threads_count(processing_threads_count)
1793  .matching_threads_count(matching_threads_count)
1794  );
1795 }
1796 
1797 inline
1799  const VideoWorker::Params params) const
1800 {
1801  std::vector<char const*> vw_overridden_keys;
1802  std::vector<double> vw_overridden_values;
1803 
1804  params._video_worker_config.prepare(vw_overridden_keys, vw_overridden_values);
1805  std::vector<std::string> extra_over_params;
1806 
1807  if(!params._active_liveness_checks_order.empty()){
1808  bool is_unique = true;
1809  for (auto it = params._active_liveness_checks_order.begin(); it != params._active_liveness_checks_order.end(); ++it)
1810  if (std::find(it + 1, params._active_liveness_checks_order.end(), *it) != params._active_liveness_checks_order.end()) {
1811  is_unique = false;
1812  break;
1813  }
1814  if(!is_unique)
1815  throw pbio::Error(0x3302330e,
1816  "Error 0x3302330e: Set a unique order of `active_liveness_checks_order` for Active Liveness.");
1817  for (size_t i = 0; i < params._active_liveness_checks_order.size(); i++){
1818  ActiveLiveness::CheckType check = params._active_liveness_checks_order[i];
1819  std::string check_str = ActiveLiveness::CheckTypeToString(check);
1820  extra_over_params.push_back("active_liveness.check_" + check_str);
1821  vw_overridden_keys.push_back(extra_over_params.back().c_str());
1822  vw_overridden_values.push_back(-(double)(i+1));
1823  }
1824  }
1825 
1826 
1827  if (!params._recognizer_ini_file.empty() && !params._recognizer_config.config_filepath.empty())
1828  throw pbio::Error(0xb3fe4d07, "Error: 0xed877a99 You must use either recognizer_config or recognizer_ini_file.");
1829 
1830  pbio::FacerecService::Config recognizer_config =
1831  params._recognizer_ini_file.empty() ?
1832  params._recognizer_config :
1833  pbio::FacerecService::Config(params._recognizer_ini_file);
1834 
1835  std::vector<char const*> rec_overridden_keys;
1836  std::vector<double> rec_overridden_values;
1837 
1838  recognizer_config.prepare(rec_overridden_keys, rec_overridden_values);
1839 
1840  void* exception = NULL;
1841 
1842  pbio::facerec::VideoWorkerImpl* const vw_impl =
1843  _dll_handle->FacerecService_createVideoWorker_sti_age_gender_emotions(
1844  _impl,
1845 
1846  VideoWorker::STrackingCallback,
1847  VideoWorker::STemplateCreatedCallback,
1848  VideoWorker::SMatchFoundCallback,
1849  VideoWorker::STrackingLostCallback,
1850  VideoWorker::SStiPersonOutdatedCallback,
1851 
1852  (_facerec_conf_dir + params._video_worker_config.config_filepath).c_str(),
1853  vw_overridden_keys.size(),
1854  vw_overridden_keys.empty() ? NULL : &(vw_overridden_keys[0]),
1855  vw_overridden_values.empty() ? NULL : &(vw_overridden_values[0]),
1856 
1857  (_facerec_conf_dir + recognizer_config.config_filepath).c_str(),
1858  rec_overridden_keys.size(),
1859  rec_overridden_keys.empty() ? NULL : &(rec_overridden_keys[0]),
1860  rec_overridden_values.empty() ? NULL : &(rec_overridden_values[0]),
1861 
1862  params._streams_count,
1863  params._processing_threads_count,
1864  params._matching_threads_count,
1865  params._short_time_identification_enabled,
1866  params._short_time_identification_distance_threshold,
1867  params._short_time_identification_outdate_time_seconds,
1868  params._age_gender_estimation_threads_count,
1869  params._emotions_estimation_threads_count,
1870  &exception);
1871 
1872  checkException(exception, *_dll_handle);
1873 
1874  return VideoWorker::Ptr::make(_dll_handle, vw_impl);
1875 }
1876 
1877 
1878 inline
1879 RawSample::Ptr FacerecService::loadRawSample(std::istream &binary_stream) const
1880 {
1881  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1882 
1883  return loadRawSample(binary_stream_wrap);
1884 }
1885 
1886 inline
1887 RawSample::Ptr FacerecService::loadRawSample(pbio::stl_wraps::WrapIStream &binary_stream) const
1888 {
1889  void* exception = NULL;
1890 
1891  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1892  _dll_handle->FacerecService_loadRawSample(
1893  _impl,
1894  &binary_stream,
1895  pbio::stl_wraps::WrapIStream::read_func,
1896  &exception);
1897 
1898  checkException(exception, *_dll_handle);
1899 
1900  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1901 }
1902 
1903 inline
1905  pbio::stl_wraps::WrapIStream &binary_stream,
1906  const RawImage image,
1907  const double space_translation_x,
1908  const double space_translation_y,
1909  const double space_scale) const
1910 {
1911  void* exception = NULL;
1912 
1913  const RawImage::CapiData cdata = image.makeCapiData();
1914 
1915  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1916  _dll_handle->FacerecService_loadRawSampleWithoutImage_raw_image(
1917  _impl,
1918  &binary_stream,
1919  pbio::stl_wraps::WrapIStream::read_func,
1920 
1921  cdata.data,
1922  cdata.width,
1923  cdata.height,
1924  cdata.format,
1925  cdata.with_crop,
1926  cdata.crop_info_offset_x,
1927  cdata.crop_info_offset_y,
1928  cdata.crop_info_data_image_width,
1929  cdata.crop_info_data_image_height,
1930 
1931  space_translation_x,
1932  space_translation_y,
1933  space_scale,
1934 
1935  &exception);
1936 
1937  checkException(exception, *_dll_handle);
1938 
1939  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1940 }
1941 
1942 inline
1944  std::istream &binary_stream,
1945  const RawImage image,
1946  const double space_translation_x,
1947  const double space_translation_y,
1948  const double space_scale) const
1949 {
1950  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1951 
1953  binary_stream_wrap,
1954  image,
1955  space_translation_x,
1956  space_translation_y,
1957  space_scale);
1958 }
1959 
1960 inline
1962  pbio::stl_wraps::WrapIStream &binary_stream,
1963  const unsigned char *image_data,
1964  int image_data_size,
1965  const double space_translation_x,
1966  const double space_translation_y,
1967  const double space_scale) const
1968 {
1969  void* exception = NULL;
1970 
1971  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1972  _dll_handle->FacerecService_loadRawSampleWithoutImage_encoded_image(
1973  _impl,
1974  &binary_stream,
1975  pbio::stl_wraps::WrapIStream::read_func,
1976 
1977  image_data,
1978  image_data_size,
1979 
1980  space_translation_x,
1981  space_translation_y,
1982  space_scale,
1983 
1984  &exception);
1985 
1986  checkException(exception, *_dll_handle);
1987 
1988  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1989 }
1990 
1991 inline
1993  std::istream &binary_stream,
1994  const unsigned char *image_data,
1995  int image_data_size,
1996  const double space_translation_x,
1997  const double space_translation_y,
1998  const double space_scale) const
1999 {
2000  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
2001 
2002 
2004  binary_stream_wrap,
2005  image_data,
2006  image_data_size,
2007  space_translation_x,
2008  space_translation_y,
2009  space_scale);
2010 }
2011 
2012 
2013 inline
2015 {
2016  void* exception = NULL;
2017 
2018  pbio::facerec::CameraCalibratorImpl* const calibrator_impl =
2019  _dll_handle->FacerecService_createCameraCalibrator(
2020  _impl,
2021  &exception);
2022 
2023  checkException(exception, *_dll_handle);
2024 
2025  return CameraCalibrator::Ptr::make(_dll_handle, calibrator_impl);
2026 }
2027 
2028 
2029 
2030 inline
2032  const std::string ini_file) const
2033 {
2034  const std::string file_path = _facerec_conf_dir + ini_file;
2035 
2036  void* exception = NULL;
2037 
2038  pbio::facerec::DepthLivenessEstimatorImpl* const the_impl =
2039  _dll_handle->FacerecService_createDepthLivenessEstimatorE(
2040  _impl,
2041  file_path.c_str(),
2042  0, // overridden keys size
2043  NULL, // overridden keys
2044  NULL, // overriden values
2045  &exception);
2046 
2047  checkException(exception, *_dll_handle);
2048 
2049  return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2050 }
2051 
2052 
2053 inline
2055  const pbio::FacerecService::Config config) const
2056 {
2057  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2058 
2059  std::vector<char const*> overridden_keys;
2060  std::vector<double> overridden_values;
2061 
2062  config.prepare(overridden_keys, overridden_values);
2063 
2064  void* exception = NULL;
2065 
2066  pbio::facerec::DepthLivenessEstimatorImpl* const the_impl =
2067  _dll_handle->FacerecService_createDepthLivenessEstimatorE(
2068  _impl,
2069  file_path.c_str(),
2070  overridden_keys.size(),
2071  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2072  overridden_values.empty() ? NULL : &(overridden_values[0]),
2073  &exception);
2074 
2075  checkException(exception, *_dll_handle);
2076 
2077  return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2078 }
2079 
2080 inline
2082  const std::string ini_file) const
2083 {
2084  const std::string file_path = _facerec_conf_dir + ini_file;
2085 
2086  void* exception = NULL;
2087 
2088  pbio::facerec::IRLivenessEstimatorImpl* const the_impl =
2089  _dll_handle->FacerecService_createIRLivenessEstimatorE(
2090  _impl,
2091  file_path.c_str(),
2092  0, // overridden keys size
2093  NULL, // overridden keys
2094  NULL, // overriden values
2095  &exception);
2096 
2097  checkException(exception, *_dll_handle);
2098 
2099  return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2100 }
2101 
2102 inline
2104  const pbio::FacerecService::Config config) const
2105 {
2106  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2107 
2108  std::vector<char const*> overridden_keys;
2109  std::vector<double> overridden_values;
2110 
2111  config.prepare(overridden_keys, overridden_values);
2112 
2113  void* exception = NULL;
2114 
2115  pbio::facerec::IRLivenessEstimatorImpl* const the_impl =
2116  _dll_handle->FacerecService_createIRLivenessEstimatorE(
2117  _impl,
2118  file_path.c_str(),
2119  overridden_keys.size(),
2120  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2121  overridden_values.empty() ? NULL : &(overridden_values[0]),
2122  &exception);
2123 
2124  checkException(exception, *_dll_handle);
2125 
2126  return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2127 }
2128 
2129 inline
2131  const std::string ini_file) const
2132 {
2133  const std::string file_path = _facerec_conf_dir + ini_file;
2134 
2135  void* exception = NULL;
2136 
2137  pbio::facerec::Liveness2DEstimatorImpl* const the_impl =
2138  _dll_handle->FacerecService_createLiveness2DEstimatorE(
2139  _impl,
2140  file_path.c_str(),
2141  0, // overridden keys size
2142  NULL, // overridden keys
2143  NULL, // overriden values
2144  &exception);
2145 
2146  checkException(exception, *_dll_handle);
2147 
2148  return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2149 }
2150 
2151 inline
2153  const pbio::FacerecService::Config config) const
2154 {
2155  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2156 
2157  std::vector<char const*> overridden_keys;
2158  std::vector<double> overridden_values;
2159 
2160  config.prepare(overridden_keys, overridden_values);
2161 
2162  void* exception = NULL;
2163 
2164  pbio::facerec::Liveness2DEstimatorImpl* const the_impl =
2165  _dll_handle->FacerecService_createLiveness2DEstimatorE(
2166  _impl,
2167  file_path.c_str(),
2168  overridden_keys.size(),
2169  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2170  overridden_values.empty() ? NULL : &(overridden_values[0]),
2171  &exception);
2172 
2173  checkException(exception, *_dll_handle);
2174 
2175  return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2176 }
2177 
2178 inline
2180  const std::string ini_file) const
2181 {
2182  const std::string file_path = _facerec_conf_dir + ini_file;
2183 
2184  void* exception = NULL;
2185 
2186  pbio::facerec::FaceAttributesEstimatorImpl* const the_impl =
2187  _dll_handle->FacerecService_createFaceAttributesEstimator(
2188  _impl,
2189  file_path.c_str(),
2190  0, // overridden keys size
2191  NULL, // overridden keys
2192  NULL, // overriden values
2193  &exception);
2194 
2195  checkException(exception, *_dll_handle);
2196 
2197  return FaceAttributesEstimator::Ptr::make(_dll_handle, the_impl);
2198 }
2199 
2201 
2202 inline
2203 ProcessingUnit::Ptr FacerecService::createProcessingUnit(
2204  const int block_type,
2205  const char* serializedConfig) const
2206 {
2207  return ProcessingUnit::Ptr::make(_dll_handle, block_type, serializedConfig);
2208 }
2209 
2210 #ifndef WITHOUT_PROCESSING_BLOCK
2211 inline Context FacerecService::createContext() const
2212 {
2213  return Context(_dll_handle);
2214 }
2215 
2216 inline Context FacerecService::createContextFromEncodedImage(const uint8_t* data, uint64_t dataSize) const
2217 {
2218  return Context(_dll_handle, data, dataSize);
2219 }
2220 
2221 inline Context FacerecService::createContextFromEncodedImage(const std::vector<uint8_t>& data) const
2222 {
2223  return Context(_dll_handle, data.data(), data.size());
2224 }
2225 
2226 inline Context FacerecService::createContextFromEncodedImage(const std::string& data) const
2227 {
2228  return Context(_dll_handle, reinterpret_cast<const uint8_t*>(data.data()), data.size());
2229 }
2230 
2231 inline Context FacerecService::createContextFromEncodedImage(const std::vector<char>& data) const
2232 {
2233  return Context(_dll_handle, reinterpret_cast<const uint8_t*>(data.data()), data.size());
2234 }
2235 
2236 inline Context FacerecService::createContextFromFrame(uint8_t* data, int32_t width, int32_t height, Context::Format format, int32_t baseAngle) const
2237 {
2238  return Context(_dll_handle, data, width, height, format, baseAngle);
2239 }
2240 
2241 inline Context FacerecService::createContextFromJsonFile(const char* path)
2242 {
2243  return Context(_dll_handle, path);
2244 }
2245 
2246 inline Context FacerecService::createContextFromJsonFile(std::string path)
2247 {
2248  return Context(_dll_handle, path.c_str());
2249 }
2250 
2251 inline ProcessingBlock FacerecService::createProcessingBlock(const Context& config) const
2252 {
2253  return ProcessingBlock(_impl, _dll_handle, config);
2254 }
2255 #endif
2256 
2258 
2259 inline
2261 {
2262  void* exception = NULL;
2263 
2264  void* struct_storage_impl = _dll_handle->FacerecService_getLicenseState(_impl, &exception);
2265 
2266  checkException(exception, *_dll_handle);
2267 
2268  const StructStorage struct_storage(_dll_handle, struct_storage_impl);
2269 
2270  LicenseState result;
2271 
2272  result.online = struct_storage.get_int64(StructStorageFields::license_state_online_t);
2273 
2274  result.android_app_id = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_app_id_t);
2275  result.android_serial = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_serial_t);
2276  result.ios_app_id = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_ios_app_id_t);
2277  result.hardware_reg = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_hardware_reg_t);
2278 
2279  result.counters.resize( struct_storage.get_int64(
2280  StructStorageFields::license_state_licenses_count_t) );
2281 
2282  for(size_t i = 0; i < result.counters.size(); ++i)
2283  {
2284  result.counters[i].name = (char const*) struct_storage.get_pointer(
2285  (i << 16) | size_t(StructStorageFields::license_state_licenses_names_int16_t) );
2286 
2287  result.counters[i].max_value = struct_storage.get_int64(
2288  (i << 16) | size_t(StructStorageFields::license_state_licenses_total_counts_int16_t) );
2289 
2290  result.counters[i].value = struct_storage.get_int64(
2291  (i << 16) | size_t(StructStorageFields::license_state_licenses_in_use_counts_int16_t) );
2292  }
2293 
2294  return result;
2295 }
2296 
2297 
2298 inline
2300 {
2301  void* exception = NULL;
2302 
2303  _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(1, &exception);
2304 
2305  checkException(exception, *_dll_handle);
2306 }
2307 
2308 inline
2310 {
2311  void* exception = NULL;
2312 
2313  _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(0, &exception);
2314 
2315  checkException(exception, *_dll_handle);
2316 }
2317 
2318 
2319 
2320 inline
2322  const int width,
2323  const int height,
2324  const RawImage::Format format)
2325 {
2326  void* exception = NULL;
2327 
2328  int32_t data_size;
2329  void* data_ptr;
2330  void* imagetptr_ptr;
2331 
2332  void* const the_impl = _dll_handle->InternalImageBuffer_constructor(
2333  width,
2334  height,
2335  format,
2336  &data_size,
2337  &data_ptr,
2338  &imagetptr_ptr,
2339  &exception);
2340 
2341  checkException(exception, *_dll_handle);
2342 
2343  return InternalImageBuffer::Ptr::make(
2344  _dll_handle,
2345  the_impl,
2346  (unsigned char*) data_ptr,
2347  data_size,
2348  width,
2349  height,
2350  format,
2351  imagetptr_ptr);
2352 }
2353 
2354 
2355 #ifdef ANDROID
2356 inline
2358  JNIEnv *env,
2359  jobject android_media_image)
2360 {
2361  void* exception = NULL;
2362 
2363  int32_t width;
2364  int32_t height;
2365  int32_t format;
2366  int32_t data_size;
2367  void* data_ptr;
2368  void* imagetptr_ptr;
2369 
2370  void* const the_impl = _dll_handle->InternalImageBuffer_constructor_from_android_image(
2371  env,
2372  android_media_image,
2373  &width,
2374  &height,
2375  &format,
2376  &data_size,
2377  &data_ptr,
2378  &imagetptr_ptr,
2379  &exception);
2380 
2381  checkException(exception, *_dll_handle);
2382 
2383  return InternalImageBuffer::Ptr::make(
2384  _dll_handle,
2385  the_impl,
2386  (unsigned char*) data_ptr,
2387  data_size,
2388  width,
2389  height,
2390  (InternalImageBuffer::Format) format,
2391  imagetptr_ptr);
2392 }
2393 #endif
2394 
2395 inline
2397  const RawImage image,
2398  const bool downscale_x2,
2399  void* const result_buffer)
2400 {
2401  void* exception = NULL;
2402 
2403  const RawImage::CapiData cdata = image.makeCapiData();
2404 
2405  _dll_handle->RawImage_convertYUV2ARGB(
2406  cdata.data,
2407  cdata.width,
2408  cdata.height,
2409  cdata.format,
2410  cdata.with_crop,
2411  cdata.crop_info_offset_x,
2412  cdata.crop_info_offset_y,
2413  cdata.crop_info_data_image_width,
2414  cdata.crop_info_data_image_height,
2415  downscale_x2,
2416  result_buffer,
2417  &exception);
2418 
2419  checkException(exception, *_dll_handle);
2420 }
2421 
2422 inline
2423 void FacerecService::convertYUV2RGB(
2424  const RawImage image,
2425  const bool downscale_x2,
2426  const int base_angle,
2427  void* const result_buffer)
2428 {
2429  void* exception = NULL;
2430 
2431  const RawImage::CapiData cdata = image.makeCapiData();
2432 
2433  _dll_handle->RawImage_convertYUV2RGB(
2434  cdata.data,
2435  cdata.width,
2436  cdata.height,
2437  cdata.format,
2438  cdata.with_crop,
2439  cdata.crop_info_offset_x,
2440  cdata.crop_info_offset_y,
2441  cdata.crop_info_data_image_width,
2442  cdata.crop_info_data_image_height,
2443  downscale_x2,
2444  base_angle,
2445  result_buffer,
2446  &exception);
2447 
2448  checkException(exception, *_dll_handle);
2449 }
2450 
2451 inline
2452 void FacerecService::convertBGRA88882RGB(
2453  const RawImage image,
2454  const bool downscale_x2,
2455  const int base_angle,
2456  void* const result_buffer)
2457 {
2458  void* exception = NULL;
2459 
2460  const RawImage::CapiData cdata = image.makeCapiData();
2461 
2462  _dll_handle->RawImage_convertYUV2RGB(
2463  cdata.data,
2464  cdata.width,
2465  cdata.height,
2466  cdata.format,
2467  cdata.with_crop,
2468  cdata.crop_info_offset_x,
2469  cdata.crop_info_offset_y,
2470  cdata.crop_info_data_image_width,
2471  cdata.crop_info_data_image_height,
2472  downscale_x2,
2473  base_angle,
2474  result_buffer,
2475  &exception);
2476 
2477  checkException(exception, *_dll_handle);
2478 }
2479 
2480 } // pbio namespace
2481 
2482 
2483 
2484 
2485 
2486 #endif // __PBIO_API__PBIO__FACEREC_SERVICE_H_
VideoWorker::Ptr createVideoWorker(const pbio::VideoWorker::Params params) const
Creates a VideoWorker object. Thread-safe. When VideoWorker is created with matching_thread=0 and pr...
Definition: FacerecService.h:1798
Interface object used to work with estimators from Processing Block API.
Definition: ProcessingBlock.h:29
std::string android_serial
Serial number of the Android device. Only available on Android (tag <android_serial>).
Definition: FacerecService.h:141
Interface object used to work with estimators from Processing Block API.
Definition: ProcessingBlock.h:16
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:28
static FacerecService::Ptr createService(const std::string dll_path, std::string facerec_conf_dir, const std::string license_dir=std::string())
Initializes the facerec lib (can be called only once).
Definition: FacerecService.h:1424
Interface object for creating other interface objects.
Definition: FacerecService.h:64
QualityEstimator - Interface object used to estimate sample quality.
FaceAttributesEstimator::Ptr createFaceAttributesEstimator(const std::string ini_file) const
Creates an FaceAttributesEstimator object. Thread-safe.
Definition: FacerecService.h:2179
LightSmartPtr< InternalImageBuffer >::tPtr Ptr
Alias for the type of a smart pointer to InternalImageBuffer.
Definition: InternalImageBuffer.h:34
CameraCalibrator - Interface object for camera calibration and correction of image distortion...
LightSmartPtr< EmotionsEstimator >::tPtr Ptr
Alias for the type of a smart pointer to EmotionsEstimator.
Definition: EmotionsEstimator.h:50
int64_t max_value
Maximum counter value (equals to the tag value).
Definition: FacerecService.h:115
State of the counter assigned to a specified license element.
Definition: FacerecService.h:103
std::string android_app_id
Android application ID. Available only on Android (tag <android_app_id>).
Definition: FacerecService.h:135
LightSmartPtr< IRLivenessEstimator >::tPtr Ptr
Alias for the type of a smart pointer to IRLivenessEstimator.
Definition: IRLivenessEstimator.h:43
LightSmartPtr< FaceQualityEstimator >::tPtr Ptr
Alias for the type of a smart pointer to FaceQualityEstimator.
Definition: FaceQualityEstimator.h:50
LightSmartPtr< VideoWorker >::tPtr Ptr
Alias for the type of a smart pointer to VideoWorker.
Definition: VideoWorker.h:72
Liveness2DEstimator is an interface object used to estimate face liveness in order to prevent spoofin...
IRLivenessEstimator::Ptr createIRLivenessEstimator(const std::string ini_file) const
Creates an IRLivenessEstimator object. Thread-safe.
Definition: FacerecService.h:2081
LightSmartPtr< CameraCalibrator >::tPtr Ptr
Alias for the type of a smart pointer to CameraCalibrator.
Definition: CameraCalibrator.h:48
LightSmartPtr< Capturer >::tPtr Ptr
Alias for the type of a smart pointer to Capturer.
Definition: Capturer.h:45
Recognizer::Ptr createRecognizer(const char *ini_file, const bool processing=true, const bool matching=true, const bool processing_less_memory_consumption=false) const
Creates a Recognizer object. Thread-safe.
Definition: FacerecService.h:1669
void convertYUV2ARGB(const RawImage image, const bool downscale_x2, void *const result_buffer)
Convert input image to android.graphics.Bitmap.Config.ARGB_8888 format. Input must be in YUV_NV21 of ...
Definition: FacerecService.h:2396
CameraCalibrator::Ptr createCameraCalibrator() const
Creates a CameraCalibrator object. Thread-safe.
Definition: FacerecService.h:2014
Parameters of the VideoWorker constructor.
Definition: VideoWorker.h:89
Capturer::Ptr createCapturer(const pbio::FacerecService::Config config) const
Creates a Capturer object. Type and features depend on the content of the configuration file...
Definition: FacerecService.h:1550
DepthLivenessEstimator - Interface object used to estimate face liveness in order to prevent spoofing...
EmotionsEstimator - Interface object for estimation of emotions.
A class used to override the configuration parameters at runtime.
Definition: Config.h:19
LightSmartPtr< RawSample >::tPtr Ptr
Alias for the type of a smart pointer to RawSample.
Definition: RawSample.h:58
LightSmartPtr< QualityEstimator >::tPtr Ptr
Alias for the type of a smart pointer to QualityEstimator.
Definition: QualityEstimator.h:50
Error - the class of exceptions thrown when errors occur.
LivenessEstimator - Interface object used to estimate face liveness to prevent spoofing attacks...
AgeGenderEstimator - interface object for age and gender estimation.
void forceOnlineLicenseUpdate() const
Force online license update.
Definition: FacerecService.h:1538
AgeGenderEstimator::Ptr createAgeGenderEstimator(const std::string ini_file) const
Creates a AgeGenderEstimator object. Thread-safe.
Definition: FacerecService.h:1577
void freeAlgorithmsCache() const
Disable keeping algorithms data in memory. Thread-safe.
Definition: FacerecService.h:2309
const std::string license_body
Сontent of a license.
Definition: FacerecService.h:87
InternalImageBuffer::Ptr createInternalImageBuffer(const int width, const int height, const RawImage::Format format)
Create InternalImageBuffer for specified image size and format. Thread-safe. Always create new Intern...
Definition: FacerecService.h:2321
std::vector< CounterState > counters
State of all license counters.
Definition: FacerecService.h:159
LightSmartPtr< Recognizer >::tPtr Ptr
Alias for the type of a smart pointer to Recognizer.
Definition: Recognizer.h:46
LightSmartPtr< FacerecService >::tPtr Ptr
Alias for the type of a smart pointer to FacerecService.
Definition: FacerecService.h:73
The class of exceptions thrown when errors occur.
Definition: Error.h:26
std::string ios_app_id
iOS application ID. Available only on iOS (tag <ios_app_id>).
Definition: FacerecService.h:147
void keepAlgorithmsCache() const
Enalbe keeping algorithms data in memory even if no owners left. This will speedup repeated algorithm...
Definition: FacerecService.h:2299
Main library header.
Liveness2DEstimator::Ptr createLiveness2DEstimator(const std::string ini_file) const
Creates an Liveness2DEstimator object. Thread-safe.
Definition: FacerecService.h:2130
std::string hardware_reg
Hardware signature (tag <Reg>).
Definition: FacerecService.h:153
FaceQualityEstimator::Ptr createFaceQualityEstimator(const std::string ini_file) const
Creates a FaceQualityEstimator object. Thread-safe.
Definition: FacerecService.h:1615
std::string getVersion() const
Get version of face recognition library. Thread-safe.
Definition: FacerecService.h:1519
QualityEstimator::Ptr createQualityEstimator(const std::string ini_file) const
Creates a QualityEstimator object. Thread-safe.
Definition: FacerecService.h:1596
bool online
Online license flag.
Definition: FacerecService.h:128
int64_t value
Current value (number of used elements).
Definition: FacerecService.h:121
std::string name
Element name (equals to the tag name).
Definition: FacerecService.h:109
Storing the license as a string variable.
Definition: FacerecService.h:81
FaceAttributesEstimator is an interface object used to estimate attributes of the face...
Context is an interface object for storing data and interacting with methods from the Processing Bloc...
Definition: Context.h:51
LightSmartPtr< Liveness2DEstimator >::tPtr Ptr
Alias for the type of a smart pointer to Liveness2DEstimator.
Definition: Liveness2DEstimator.h:50
SmartPtr.
Context is an interface object for storing data and interacting with methods from the Processing Bloc...
Definition: Context.h:65
IRLivenessEstimator is an interface object used to estimate face liveness in order to prevent spoofin...
LicenseState getLicenseState() const
Get the license state. Thread-safe.
Definition: FacerecService.h:2260
LightSmartPtr< FaceAttributesEstimator >::tPtr Ptr
Alias for the type of a smart pointer to FaceAttributesEstimator.
Definition: FaceAttributesEstimator.h:37
RawSample::Ptr loadRawSample(std::istream &binary_stream) const
Loads a RawSample object that was saved with the RawSample::save member function. The format is platf...
Definition: FacerecService.h:1879
LightSmartPtr< LivenessEstimator >::tPtr Ptr
Alias for the type of a smart pointer to LivenessEstimator.
Definition: LivenessEstimator.h:42
RawSample::Ptr loadRawSampleWithoutImage(pbio::stl_wraps::WrapIStream &binary_stream, const RawImage image, const double space_translation_x=0, const double space_translation_y=0, const double space_scale=1) const
Loads a RawSample object that was saved with the RawSample::saveWithoutImage member function...
Definition: FacerecService.h:1904
EmotionsEstimator::Ptr createEmotionsEstimator(const std::string ini_file) const
Creates a EmotionsEstimator object. Thread-safe.
Definition: FacerecService.h:1649
Format
Format of image data.
Definition: IRawImage.h:46
LightSmartPtr< AgeGenderEstimator >::tPtr Ptr
Alias for the type of a smart pointer to AgeGenderEstimator.
Definition: AgeGenderEstimator.h:55
LivenessEstimator::Ptr createLivenessEstimator() const
Creates a LivenessEstimator object. Thread-safe.
Definition: FacerecService.h:1633
CheckType
Check type for active liveness.
Definition: ActiveLiveness.h:14
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:113
FaceQualityEstimator - Interface object for sample quality estimation.
DepthLivenessEstimator::Ptr createDepthLivenessEstimator(const std::string ini_file) const
Creates a DepthLivenessEstimator object. Thread-safe.
Definition: FacerecService.h:2031
License status.
Definition: FacerecService.h:97
LightSmartPtr< DepthLivenessEstimator >::tPtr Ptr
Alias for the type of a smart pointer to DepthLivenessEstimator.
Definition: DepthLivenessEstimator.h:43