Responsible for creation of Authenticator and Identificator instances.
More...
#include <Engine.hpp>
|
| auto | model (std::string const &name) -> std::shared_ptr< Model > |
| | Loads model name.
|
| |
| auto | loadedModels () const -> std::unordered_map< std::string, std::shared_ptr< Model > > const & |
| | Gets the list of already loaded models.
|
| |
| virtual auto | loadableModelNames () const -> std::vector< std::string >=0 |
| | Gets the list of model names that can be loaded.
|
| |
| auto | makeModel (std::string name, ModelType type) -> std::shared_ptr< Model > |
| | Creates a new, empty model of type type named name.
|
| |
| auto | unloadModel (std::string const &name) -> size_t |
| | Releases the model from the engine.
|
| |
| auto | unloadModel (std::shared_ptr< Model > &&model) -> size_t |
| | Releases the model from the engine.
|
| |
| void | unloadModels () |
| | Releases loaded models from the engine.
|
| |
| void | deleteModel (std::string const &name) |
| | Unloads (if needed) and deletes the model from the filesystem.
|
| |
| auto | makeAuthenticator (std::string name, std::shared_ptr< Model > model=nullptr, int threshold=5) -> std::shared_ptr< Authenticator > |
| | Creates a default constructed authenticator, initialized with model and threshold.
|
| |
| auto | makeIdentificator (std::string name, std::shared_ptr< Model > model=nullptr, int threshold=5) -> std::shared_ptr< Identificator > |
| | Creates a default constructed identificator, initialized with model and threshold.
|
| |
|
| template<class T , typename... Args> |
| static auto | make (Args &&... args) -> std::shared_ptr< Engine > |
| | Gets or constructs a shared Biometrics::Engine instance of type T with args.
|
| |
Responsible for creation of Authenticator and Identificator instances.
◆ Engine() [1/3]
| Engine::Engine |
( |
char const * | name, |
|
|
std::string const & | configPath ) |
|
protected |
- Parameters
-
| name | Name of the configuration object in vsdk.json |
| configPath | Path to a vsdk.json formatted file |
◆ Engine() [2/3]
| Engine::Engine |
( |
char const * | name, |
|
|
nlohmann::json | config ) |
|
protected |
- Parameters
-
| name | Name of the configuration object in vsdk.json |
| config | A vsdk.json formatted JSON configuration object |
◆ Engine() [3/3]
| Engine::Engine |
( |
char const * | name, |
|
|
char const * | configPath ) |
|
protected |
Specialization used to avoid overload collisions, forwards to Engine(char const*, std::string const &);
- Parameters
-
| name | Name of the configuration object in vsdk.json |
| configPath | Path to a vsdk.json formatted file |
◆ make()
template<class T , typename... Args>
| static auto Vsdk::Biometrics::Engine::make |
( |
Args &&... | args | ) |
-> std::shared_ptr<Engine>
|
|
static |
Gets or constructs a shared Biometrics::Engine instance of type T with args.
- Note
- If an engine of this type exists, a shared instance will be returned instead.
◆ model()
| auto Engine::model |
( |
std::string const & | name | ) |
-> std::shared_ptr<Model> |
◆ loadedModels()
| auto Engine::loadedModels |
( |
| ) |
const -> std::unordered_map<std::string, std::shared_ptr<Model>> const & |
Gets the list of already loaded models.
◆ loadableModelNames()
| virtual auto Vsdk::Biometrics::Engine::loadableModelNames |
( |
| ) |
const -> std::vector< std::string > |
|
pure virtual |
Gets the list of model names that can be loaded.
- Note
- Does not contain the already loaded model names
◆ makeModel()
| auto Engine::makeModel |
( |
std::string | name, |
|
|
ModelType | type ) -> std::shared_ptr<Model> |
Creates a new, empty model of type type named name.
◆ unloadModel() [1/2]
| auto Engine::unloadModel |
( |
std::string const & | name | ) |
-> size_t |
Releases the model from the engine.
- Note
- The model will truly unload once the user releases all shared instances of it
- Exceptions
-
| Vsdk::Exception | if the model cannot be found |
◆ unloadModel() [2/2]
| auto Engine::unloadModel |
( |
std::shared_ptr< Model > && | model | ) |
-> size_t |
Releases the model from the engine.
- Note
- The model will truly unload once the user releases all shared instances of it
- Exceptions
-
| Vsdk::Exception | if the model cannot be found |
◆ unloadModels()
| void Engine::unloadModels |
( |
| ) |
|
Releases loaded models from the engine.
- Note
- The models will truly unload once the user releases all shared instances for each of them
◆ deleteModel()
| void Engine::deleteModel |
( |
std::string const & | name | ) |
|
Unloads (if needed) and deletes the model from the filesystem.
- Note
- The model will truly unload and get deleted once the user releases all shared instances of it
◆ makeAuthenticator()
| auto Engine::makeAuthenticator |
( |
std::string | name, |
|
|
std::shared_ptr< Model > | model = nullptr, |
|
|
int | threshold = 5 ) -> std::shared_ptr<Authenticator> |
Creates a default constructed authenticator, initialized with model and threshold.
- Parameters
-
| threshold | Must be between [ 0 ; 10 ] |
◆ makeIdentificator()
| auto Engine::makeIdentificator |
( |
std::string | name, |
|
|
std::shared_ptr< Model > | model = nullptr, |
|
|
int | threshold = 5 ) -> std::shared_ptr<Identificator> |
Creates a default constructed identificator, initialized with model and threshold.
- Parameters
-
| threshold | Must be between [ 0 ; 10 ] |
◆ modelExistsOnFilesystem()
| virtual bool Vsdk::Biometrics::Engine::modelExistsOnFilesystem |
( |
std::string const & | name | ) |
const |
|
protectedpure virtual |
◆ makeModelImpl()
| virtual auto Vsdk::Biometrics::Engine::makeModelImpl |
( |
std::string | name, |
|
|
ModelType | type ) -> Model * |
|
protectedpure virtual |
◆ makeAuthenticatorImpl()
| virtual auto Vsdk::Biometrics::Engine::makeAuthenticatorImpl |
( |
std::string | name | ) |
-> Authenticator * |
|
protectedpure virtual |
◆ makeIdentificatorImpl()
| virtual auto Vsdk::Biometrics::Engine::makeIdentificatorImpl |
( |
std::string | name | ) |
-> Identificator * |
|
protectedpure virtual |
◆ deleteModelImpl()
| virtual void Vsdk::Biometrics::Engine::deleteModelImpl |
( |
std::string const & | name | ) |
|
|
protectedpure virtual |