9 #ifndef __PBIO_API__PBIO__FACEREC_SERVICE_H_
10 #define __PBIO_API__PBIO__FACEREC_SERVICE_H_
23 #include "stl_wraps_impls/WrapIStreamImpl.h"
24 #include "stl_wraps_impls/WrapOStreamImpl.h"
30 #include "ComplexObject.h"
33 #include "ActiveLiveness.h"
38 #include "ExceptionCheck.h"
47 #include "StructStorage.h"
49 #include "ProcessingUnit.h"
51 #ifndef WITHOUT_PROCESSING_BLOCK
73 typedef LightSmartPtr<FacerecService>::tPtr
Ptr;
200 const std::string dll_path,
201 std::string facerec_conf_dir,
202 const std::string license_dir = std::string());
238 const std::string dll_path,
239 std::string facerec_conf_dir,
247 const std::string dll_path,
248 std::string facerec_conf_dir,
249 const std::string license,
250 const bool is_license_dir);
475 const char* ini_file,
476 const bool processing =
true,
477 const bool matching =
true,
478 const bool processing_less_memory_consumption =
false)
const;
526 const bool processing =
true,
527 const bool matching =
true,
528 const bool processing_less_memory_consumption =
false)
const;
608 const char* recognizer_ini_file,
609 const int streams_count,
610 const int processing_threads_count,
611 const int matching_threads_count)
const;
658 const int streams_count,
659 const int processing_threads_count,
660 const int matching_threads_count)
const;
786 pbio::stl_wraps::WrapIStream &binary_stream,
788 const double space_translation_x = 0,
789 const double space_translation_y = 0,
790 const double space_scale = 1)
const;
796 std::istream &binary_stream,
798 const double space_translation_x = 0,
799 const double space_translation_y = 0,
800 const double space_scale = 1)
const;
856 pbio::stl_wraps::WrapIStream &binary_stream,
857 const unsigned char *image_data,
859 const double space_translation_x = 0,
860 const double space_translation_y = 0,
861 const double space_scale = 1)
const;
868 std::istream &binary_stream,
869 const unsigned char *image_data,
871 const double space_translation_x = 0,
872 const double space_translation_y = 0,
873 const double space_scale = 1)
const;
920 const std::string ini_file)
const;
974 const std::string ini_file)
const;
1028 const std::string ini_file)
const;
1081 const std::string ini_file)
const;
1085 ProcessingUnit::Ptr createProcessingUnit(
1086 const int block_type,
1087 const char* serializedConfig)
const;
1089 #ifndef WITHOUT_PROCESSING_BLOCK
1090 Context createContext()
const;
1233 jobject android_media_image);
1234 #endif // ifdef ANDROID
1279 const bool downscale_x2,
1280 void*
const result_buffer);
1283 void convertYUV2RGB(
1285 const bool downscale_x2,
1286 const int base_angle,
1287 void*
const result_buffer);
1292 const std::string _facerec_conf_dir;
1297 const DHPtr &dll_handle,
1298 const std::string &facerec_conf_dir,
1319 const std::string dll_path,
1320 std::string facerec_conf_dir,
1321 const std::string license_dir)
1323 return createService(NULL, dll_path, facerec_conf_dir, license_dir,
true);
1329 const std::string dll_path,
1330 std::string facerec_conf_dir,
1340 const std::string dll_path,
1341 std::string facerec_conf_dir,
1342 const std::string license,
1343 const bool is_license_dir)
1346 #ifdef __STATIC_LIBFACEREC_BUILD__
1349 const DHPtr dll_handle( DHPtr::make() );
1351 const DHPtr dll_handle( DHPtr::make(dll_path.c_str()) );
1354 if(facerec_conf_dir.empty())
1356 facerec_conf_dir =
"./";
1358 else if(facerec_conf_dir[facerec_conf_dir.length() - 1] !=
'/')
1360 facerec_conf_dir +=
'/';
1363 void* exception = NULL;
1369 the_impl = dll_handle->FacerecService_constructor3(
1371 facerec_conf_dir.c_str(),
1379 the_impl = dll_handle->FacerecService_constructor5(
1381 facerec_conf_dir.c_str(),
1387 checkException(exception, *dll_handle);
1389 return FacerecService::Ptr::make(
1397 FacerecService::FacerecService(
1398 const DHPtr &dll_handle,
1399 const std::string &facerec_conf_dir,
1401 ComplexObject(dll_handle, impl),
1402 _facerec_conf_dir(facerec_conf_dir)
1406 if (LIBFACEREC_VERSION != lib_version)
1407 std::cerr <<
"WARNING: The version in the header does not match the version in the library. Header version: "
1408 << LIBFACEREC_VERSION <<
", library version: " << lib_version << std::endl;
1415 std::ostringstream version_stream;
1416 pbio::stl_wraps::WrapOStreamImpl version_stream_wrap(version_stream);
1418 void* exception = NULL;
1420 _dll_handle->get_version(
1421 &version_stream_wrap,
1422 pbio::stl_wraps::WrapOStream::write_func,
1425 checkException(exception, *_dll_handle);
1427 return version_stream.str();
1434 void* exception = NULL;
1436 _dll_handle->FacerecService_forceOnlineLicenseUpdate(
1440 checkException(exception, *_dll_handle);
1447 const std::string file_path = _facerec_conf_dir + config.config_filepath;
1449 std::vector<char const*> overridden_keys;
1450 std::vector<double> overridden_values;
1452 config.prepare(overridden_keys, overridden_values);
1454 void* exception = NULL;
1456 pbio::facerec::CapturerImpl*
const capturer_impl =
1457 _dll_handle->FacerecService_createCapturerE(
1460 overridden_keys.size(),
1461 overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1462 overridden_values.empty() ? NULL : &(overridden_values[0]),
1465 checkException(exception, *_dll_handle);
1467 return Capturer::Ptr::make(_dll_handle, capturer_impl);
1473 const std::string file_path = _facerec_conf_dir + ini_file;
1475 void* exception = NULL;
1477 pbio::facerec::AgeGenderEstimatorImpl*
const the_impl =
1478 _dll_handle->FacerecService_createAgeGenderEstimator(
1483 checkException(exception, *_dll_handle);
1485 return AgeGenderEstimator::Ptr::make(_dll_handle, the_impl);
1492 const std::string file_path = _facerec_conf_dir + ini_file;
1494 void* exception = NULL;
1496 pbio::facerec::QualityEstimatorImpl*
const the_impl =
1497 _dll_handle->FacerecService_createQualityEstimator(
1502 checkException(exception, *_dll_handle);
1504 return QualityEstimator::Ptr::make(_dll_handle, the_impl);
1511 const std::string file_path = _facerec_conf_dir + ini_file;
1513 void* exception = NULL;
1515 pbio::facerec::FaceQualityEstimatorImpl*
const the_impl =
1516 _dll_handle->FacerecService_createFaceQualityEstimator(
1521 checkException(exception, *_dll_handle);
1523 return FaceQualityEstimator::Ptr::make(_dll_handle, the_impl);
1529 void* exception = NULL;
1531 pbio::facerec::LivenessEstimatorImpl*
const the_impl =
1532 _dll_handle->FacerecService_createLivenessEstimator(
1536 checkException(exception, *_dll_handle);
1538 return LivenessEstimator::Ptr::make(_dll_handle, the_impl);
1544 const std::string ini_file)
const
1546 const std::string file_path = _facerec_conf_dir + ini_file;
1548 void* exception = NULL;
1550 pbio::facerec::EmotionsEstimatorImpl*
const the_impl =
1551 _dll_handle->FacerecService_createEmotionsEstimator(
1556 checkException(exception, *_dll_handle);
1558 return EmotionsEstimator::Ptr::make(_dll_handle, the_impl);
1564 const char* ini_file,
1565 const bool processing,
1566 const bool matching,
1567 const bool processing_less_memory_consumption)
const
1569 const std::string file_path = _facerec_conf_dir + ini_file;
1571 void* exception = NULL;
1573 pbio::facerec::RecognizerImpl*
const recognizer_impl =
1574 _dll_handle->FacerecService_createRecognizer2(
1582 (int) processing_less_memory_consumption,
1585 checkException(exception, *_dll_handle);
1587 return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1594 const bool processing,
1595 const bool matching,
1596 const bool processing_less_memory_consumption)
const
1598 const std::string file_path = _facerec_conf_dir + recognizer_config.config_filepath;
1600 std::vector<char const*> overridden_keys;
1601 std::vector<double> overridden_values;
1603 recognizer_config.prepare(overridden_keys, overridden_values);
1605 void* exception = NULL;
1607 pbio::facerec::RecognizerImpl*
const recognizer_impl =
1608 _dll_handle->FacerecService_createRecognizer2(
1611 overridden_keys.size(),
1612 overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1613 overridden_values.empty() ? NULL : &(overridden_values[0]),
1616 (
int) processing_less_memory_consumption,
1619 checkException(exception, *_dll_handle);
1621 return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1629 const char* recognizer_ini_file,
1630 const int streams_count,
1631 const int processing_threads_count,
1632 const int matching_threads_count)
const
1636 .video_worker_config(video_worker_ini_file)
1637 .recognizer_ini_file(recognizer_ini_file)
1638 .streams_count(streams_count)
1639 .processing_threads_count(processing_threads_count)
1640 .matching_threads_count(matching_threads_count)
1648 const int streams_count,
1649 const int processing_threads_count,
1650 const int matching_threads_count)
const
1654 .video_worker_config(video_worker_ini_file)
1655 .recognizer_config(recognizer_config)
1656 .streams_count(streams_count)
1657 .processing_threads_count(processing_threads_count)
1658 .matching_threads_count(matching_threads_count)
1666 std::vector<char const*> vw_overridden_keys;
1667 std::vector<double> vw_overridden_values;
1669 params._video_worker_config.prepare(vw_overridden_keys, vw_overridden_values);
1670 std::vector<std::string> extra_over_params;
1672 if(!params._active_liveness_checks_order.empty()){
1673 bool is_unique =
true;
1674 for (
auto it = params._active_liveness_checks_order.begin(); it != params._active_liveness_checks_order.end(); ++it)
1675 if (std::find(it + 1, params._active_liveness_checks_order.end(), *it) != params._active_liveness_checks_order.end()) {
1681 "Error 0x3302330e: Set a unique order of `active_liveness_checks_order` for Active Liveness.");
1682 for (
size_t i = 0; i < params._active_liveness_checks_order.size(); i++){
1684 std::string check_str = ActiveLiveness::CheckTypeToString(check);
1685 extra_over_params.push_back(
"active_liveness.check_" + check_str);
1686 vw_overridden_keys.push_back(extra_over_params.back().c_str());
1687 vw_overridden_values.push_back(-(
double)(i+1));
1692 if (!params._recognizer_ini_file.empty() && !params._recognizer_config.config_filepath.empty())
1693 throw pbio::Error(0xb3fe4d07,
"Error: 0xed877a99 You must use either recognizer_config or recognizer_ini_file.");
1696 params._recognizer_ini_file.empty() ?
1697 params._recognizer_config :
1700 std::vector<char const*> rec_overridden_keys;
1701 std::vector<double> rec_overridden_values;
1703 recognizer_config.prepare(rec_overridden_keys, rec_overridden_values);
1705 void* exception = NULL;
1707 pbio::facerec::VideoWorkerImpl*
const vw_impl =
1708 _dll_handle->FacerecService_createVideoWorker_sti_age_gender_emotions(
1711 VideoWorker::STrackingCallback,
1712 VideoWorker::STemplateCreatedCallback,
1713 VideoWorker::SMatchFoundCallback,
1714 VideoWorker::STrackingLostCallback,
1715 VideoWorker::SStiPersonOutdatedCallback,
1717 (_facerec_conf_dir + params._video_worker_config.config_filepath).c_str(),
1718 vw_overridden_keys.size(),
1719 vw_overridden_keys.empty() ? NULL : &(vw_overridden_keys[0]),
1720 vw_overridden_values.empty() ? NULL : &(vw_overridden_values[0]),
1722 (_facerec_conf_dir + recognizer_config.config_filepath).c_str(),
1723 rec_overridden_keys.size(),
1724 rec_overridden_keys.empty() ? NULL : &(rec_overridden_keys[0]),
1725 rec_overridden_values.empty() ? NULL : &(rec_overridden_values[0]),
1727 params._streams_count,
1728 params._processing_threads_count,
1729 params._matching_threads_count,
1730 params._short_time_identification_enabled,
1731 params._short_time_identification_distance_threshold,
1732 params._short_time_identification_outdate_time_seconds,
1733 params._age_gender_estimation_threads_count,
1734 params._emotions_estimation_threads_count,
1737 checkException(exception, *_dll_handle);
1739 return VideoWorker::Ptr::make(_dll_handle, vw_impl);
1746 pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1754 void* exception = NULL;
1756 pbio::facerec::RawSampleImpl*
const raw_sampl_impl =
1757 _dll_handle->FacerecService_loadRawSample(
1760 pbio::stl_wraps::WrapIStream::read_func,
1763 checkException(exception, *_dll_handle);
1765 return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1770 pbio::stl_wraps::WrapIStream &binary_stream,
1772 const double space_translation_x,
1773 const double space_translation_y,
1774 const double space_scale)
const
1776 void* exception = NULL;
1778 const RawImage::CapiData cdata = image.makeCapiData();
1780 pbio::facerec::RawSampleImpl*
const raw_sampl_impl =
1781 _dll_handle->FacerecService_loadRawSampleWithoutImage_raw_image(
1784 pbio::stl_wraps::WrapIStream::read_func,
1791 cdata.crop_info_offset_x,
1792 cdata.crop_info_offset_y,
1793 cdata.crop_info_data_image_width,
1794 cdata.crop_info_data_image_height,
1796 space_translation_x,
1797 space_translation_y,
1802 checkException(exception, *_dll_handle);
1804 return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1809 std::istream &binary_stream,
1811 const double space_translation_x,
1812 const double space_translation_y,
1813 const double space_scale)
const
1815 pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1820 space_translation_x,
1821 space_translation_y,
1827 pbio::stl_wraps::WrapIStream &binary_stream,
1828 const unsigned char *image_data,
1829 int image_data_size,
1830 const double space_translation_x,
1831 const double space_translation_y,
1832 const double space_scale)
const
1834 void* exception = NULL;
1836 pbio::facerec::RawSampleImpl*
const raw_sampl_impl =
1837 _dll_handle->FacerecService_loadRawSampleWithoutImage_encoded_image(
1840 pbio::stl_wraps::WrapIStream::read_func,
1845 space_translation_x,
1846 space_translation_y,
1851 checkException(exception, *_dll_handle);
1853 return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1858 std::istream &binary_stream,
1859 const unsigned char *image_data,
1860 int image_data_size,
1861 const double space_translation_x,
1862 const double space_translation_y,
1863 const double space_scale)
const
1865 pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1872 space_translation_x,
1873 space_translation_y,
1881 void* exception = NULL;
1883 pbio::facerec::CameraCalibratorImpl*
const calibrator_impl =
1884 _dll_handle->FacerecService_createCameraCalibrator(
1888 checkException(exception, *_dll_handle);
1890 return CameraCalibrator::Ptr::make(_dll_handle, calibrator_impl);
1897 const std::string ini_file)
const
1899 const std::string file_path = _facerec_conf_dir + ini_file;
1901 void* exception = NULL;
1903 pbio::facerec::DepthLivenessEstimatorImpl*
const the_impl =
1904 _dll_handle->FacerecService_createDepthLivenessEstimatorE(
1912 checkException(exception, *_dll_handle);
1914 return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
1922 const std::string file_path = _facerec_conf_dir + config.config_filepath;
1924 std::vector<char const*> overridden_keys;
1925 std::vector<double> overridden_values;
1927 config.prepare(overridden_keys, overridden_values);
1929 void* exception = NULL;
1931 pbio::facerec::DepthLivenessEstimatorImpl*
const the_impl =
1932 _dll_handle->FacerecService_createDepthLivenessEstimatorE(
1935 overridden_keys.size(),
1936 overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1937 overridden_values.empty() ? NULL : &(overridden_values[0]),
1940 checkException(exception, *_dll_handle);
1942 return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
1947 const std::string ini_file)
const
1949 const std::string file_path = _facerec_conf_dir + ini_file;
1951 void* exception = NULL;
1953 pbio::facerec::IRLivenessEstimatorImpl*
const the_impl =
1954 _dll_handle->FacerecService_createIRLivenessEstimatorE(
1962 checkException(exception, *_dll_handle);
1964 return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
1971 const std::string file_path = _facerec_conf_dir + config.config_filepath;
1973 std::vector<char const*> overridden_keys;
1974 std::vector<double> overridden_values;
1976 config.prepare(overridden_keys, overridden_values);
1978 void* exception = NULL;
1980 pbio::facerec::IRLivenessEstimatorImpl*
const the_impl =
1981 _dll_handle->FacerecService_createIRLivenessEstimatorE(
1984 overridden_keys.size(),
1985 overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1986 overridden_values.empty() ? NULL : &(overridden_values[0]),
1989 checkException(exception, *_dll_handle);
1991 return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
1996 const std::string ini_file)
const
1998 const std::string file_path = _facerec_conf_dir + ini_file;
2000 void* exception = NULL;
2002 pbio::facerec::Liveness2DEstimatorImpl*
const the_impl =
2003 _dll_handle->FacerecService_createLiveness2DEstimatorE(
2011 checkException(exception, *_dll_handle);
2013 return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2020 const std::string file_path = _facerec_conf_dir + config.config_filepath;
2022 std::vector<char const*> overridden_keys;
2023 std::vector<double> overridden_values;
2025 config.prepare(overridden_keys, overridden_values);
2027 void* exception = NULL;
2029 pbio::facerec::Liveness2DEstimatorImpl*
const the_impl =
2030 _dll_handle->FacerecService_createLiveness2DEstimatorE(
2033 overridden_keys.size(),
2034 overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2035 overridden_values.empty() ? NULL : &(overridden_values[0]),
2038 checkException(exception, *_dll_handle);
2040 return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2045 const std::string ini_file)
const
2047 const std::string file_path = _facerec_conf_dir + ini_file;
2049 void* exception = NULL;
2051 pbio::facerec::FaceAttributesEstimatorImpl*
const the_impl =
2052 _dll_handle->FacerecService_createFaceAttributesEstimator(
2060 checkException(exception, *_dll_handle);
2062 return FaceAttributesEstimator::Ptr::make(_dll_handle, the_impl);
2068 ProcessingUnit::Ptr FacerecService::createProcessingUnit(
2069 const int block_type,
2070 const char* serializedConfig)
const
2072 return ProcessingUnit::Ptr::make(_dll_handle, block_type, serializedConfig);
2075 #ifndef WITHOUT_PROCESSING_BLOCK
2076 inline Context FacerecService::createContext()
const
2078 return Context(_dll_handle);
2081 inline ProcessingBlock FacerecService::createProcessingBlock(
const Context& config)
const
2083 return ProcessingBlock(_impl, _dll_handle, config);
2092 void* exception = NULL;
2094 void* struct_storage_impl = _dll_handle->FacerecService_getLicenseState(_impl, &exception);
2096 checkException(exception, *_dll_handle);
2098 const StructStorage struct_storage(_dll_handle, struct_storage_impl);
2102 result.
online = struct_storage.get_int64(StructStorageFields::license_state_online_t);
2104 result.
android_app_id = (
char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_app_id_t);
2105 result.
android_serial = (
char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_serial_t);
2106 result.
ios_app_id = (
char const*) struct_storage.get_pointer(StructStorageFields::license_state_ios_app_id_t);
2107 result.
hardware_reg = (
char const*) struct_storage.get_pointer(StructStorageFields::license_state_hardware_reg_t);
2109 result.
counters.resize( struct_storage.get_int64(
2110 StructStorageFields::license_state_licenses_count_t) );
2112 for(
size_t i = 0; i < result.
counters.size(); ++i)
2114 result.
counters[i].name = (
char const*) struct_storage.get_pointer(
2115 (i << 16) |
size_t(StructStorageFields::license_state_licenses_names_int16_t) );
2117 result.
counters[i].max_value = struct_storage.get_int64(
2118 (i << 16) |
size_t(StructStorageFields::license_state_licenses_total_counts_int16_t) );
2120 result.
counters[i].value = struct_storage.get_int64(
2121 (i << 16) |
size_t(StructStorageFields::license_state_licenses_in_use_counts_int16_t) );
2131 void* exception = NULL;
2133 _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(1, &exception);
2135 checkException(exception, *_dll_handle);
2141 void* exception = NULL;
2143 _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(0, &exception);
2145 checkException(exception, *_dll_handle);
2156 void* exception = NULL;
2160 void* imagetptr_ptr;
2162 void*
const the_impl = _dll_handle->InternalImageBuffer_constructor(
2171 checkException(exception, *_dll_handle);
2173 return InternalImageBuffer::Ptr::make(
2176 (
unsigned char*) data_ptr,
2189 jobject android_media_image)
2191 void* exception = NULL;
2198 void* imagetptr_ptr;
2200 void*
const the_impl = _dll_handle->InternalImageBuffer_constructor_from_android_image(
2202 android_media_image,
2211 checkException(exception, *_dll_handle);
2213 return InternalImageBuffer::Ptr::make(
2216 (
unsigned char*) data_ptr,
2228 const bool downscale_x2,
2229 void*
const result_buffer)
2231 void* exception = NULL;
2233 const RawImage::CapiData cdata = image.makeCapiData();
2235 _dll_handle->RawImage_convertYUV2ARGB(
2241 cdata.crop_info_offset_x,
2242 cdata.crop_info_offset_y,
2243 cdata.crop_info_data_image_width,
2244 cdata.crop_info_data_image_height,
2249 checkException(exception, *_dll_handle);
2253 void FacerecService::convertYUV2RGB(
2255 const bool downscale_x2,
2256 const int base_angle,
2257 void*
const result_buffer)
2259 void* exception = NULL;
2261 const RawImage::CapiData cdata = image.makeCapiData();
2263 _dll_handle->RawImage_convertYUV2RGB(
2269 cdata.crop_info_offset_x,
2270 cdata.crop_info_offset_y,
2271 cdata.crop_info_data_image_width,
2272 cdata.crop_info_data_image_height,
2278 checkException(exception, *_dll_handle);
2288 #endif // __PBIO_API__PBIO__FACEREC_SERVICE_H_
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
void keepAlgorithmsCache() const
Enalbe keeping algorithms data in memory even if no owners left. This will speedup repeated algorithm...
Definition: FacerecService.h:2129
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:28
Interface object for creating other interface objects.
Definition: FacerecService.h:64
ProcessingBlock - Interface object used to work with estimators from Processing Block API...
QualityEstimator - Interface object used to estimate sample quality.
VideoWorker is an interface object for tracking, processing and matching faces on multiple video stre...
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...
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:1744
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:1318
LightSmartPtr< EmotionsEstimator >::tPtr Ptr
Alias for the type of a smart pointer to EmotionsEstimator.
Definition: EmotionsEstimator.h:50
Recognizer - Interface object for creating and matching templates.
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...
Capturer - Interface object for detecting or tracking of faces in the images or video sequences...
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
Parameters of the VideoWorker constructor.
Definition: VideoWorker.h:89
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
IRLivenessEstimator::Ptr createIRLivenessEstimator(const std::string ini_file) const
Creates an IRLivenessEstimator object. Thread-safe.
Definition: FacerecService.h:1946
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
FaceQualityEstimator::Ptr createFaceQualityEstimator(const std::string ini_file) const
Creates a FaceQualityEstimator object. Thread-safe.
Definition: FacerecService.h:1509
Error - the class of exceptions thrown when errors occur.
Template - Interface object for saving the face template.
RawSample - Interface object that stores a captured face sample.
CameraCalibrator::Ptr createCameraCalibrator() const
Creates a CameraCalibrator object. Thread-safe.
Definition: FacerecService.h:1879
LivenessEstimator - Interface object used to estimate face liveness to prevent spoofing attacks...
Liveness2DEstimator::Ptr createLiveness2DEstimator(const std::string ini_file) const
Creates an Liveness2DEstimator object. Thread-safe.
Definition: FacerecService.h:1995
AgeGenderEstimator - interface object for age and gender estimation.
EmotionsEstimator::Ptr createEmotionsEstimator(const std::string ini_file) const
Creates a EmotionsEstimator object. Thread-safe.
Definition: FacerecService.h:1543
const std::string license_body
Сontent of a license.
Definition: FacerecService.h:87
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
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:2151
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
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:1444
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:1663
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:1563
std::string hardware_reg
Hardware signature (tag <Reg>).
Definition: FacerecService.h:153
void forceOnlineLicenseUpdate() const
Force online license update.
Definition: FacerecService.h:1432
LicenseState getLicenseState() const
Get the license state. Thread-safe.
Definition: FacerecService.h:2090
DepthLivenessEstimator::Ptr createDepthLivenessEstimator(const std::string ini_file) const
Creates a DepthLivenessEstimator object. Thread-safe.
Definition: FacerecService.h:1896
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...
AgeGenderEstimator::Ptr createAgeGenderEstimator(const std::string ini_file) const
Creates a AgeGenderEstimator object. Thread-safe.
Definition: FacerecService.h:1471
LightSmartPtr< Liveness2DEstimator >::tPtr Ptr
Alias for the type of a smart pointer to Liveness2DEstimator.
Definition: Liveness2DEstimator.h:50
void freeAlgorithmsCache() const
Disable keeping algorithms data in memory. Thread-safe.
Definition: FacerecService.h:2139
IRLivenessEstimator is an interface object used to estimate face liveness in order to prevent spoofin...
std::string getVersion() const
Get version of face recognition library. Thread-safe.
Definition: FacerecService.h:1413
LightSmartPtr< FaceAttributesEstimator >::tPtr Ptr
Alias for the type of a smart pointer to FaceAttributesEstimator.
Definition: FaceAttributesEstimator.h:37
FaceAttributesEstimator::Ptr createFaceAttributesEstimator(const std::string ini_file) const
Creates an FaceAttributesEstimator object. Thread-safe.
Definition: FacerecService.h:2044
LightSmartPtr< LivenessEstimator >::tPtr Ptr
Alias for the type of a smart pointer to LivenessEstimator.
Definition: LivenessEstimator.h:42
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
CheckType
Check type for active liveness.
Definition: ActiveLiveness.h:14
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:2226
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:1769
QualityEstimator::Ptr createQualityEstimator(const std::string ini_file) const
Creates a QualityEstimator object. Thread-safe.
Definition: FacerecService.h:1490
FaceQualityEstimator - Interface object for sample quality estimation.
License status.
Definition: FacerecService.h:97
LivenessEstimator::Ptr createLivenessEstimator() const
Creates a LivenessEstimator object. Thread-safe.
Definition: FacerecService.h:1527
LightSmartPtr< DepthLivenessEstimator >::tPtr Ptr
Alias for the type of a smart pointer to DepthLivenessEstimator.
Definition: DepthLivenessEstimator.h:43