Face Engine SDK  5.21.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fsdk::IDynamicIndex Struct Referenceabstract

Dynamic index interface. More...

#include <IIndex.h>

Inheritance diagram for fsdk::IDynamicIndex:
fsdk::IDynamicDescriptorStorage fsdk::IIndex fsdk::IStaticDescriptorStorage fsdk::IRefCounted

Public Member Functions

virtual Result< FSDKErrorsaveToDenseIndex (const char *path) const noexcept=0
 Saves index as dense. More...
 
virtual Result< FSDKErrorsaveToDynamicIndex (const char *path) const noexcept=0
 Saves index as dynamic. More...
 
virtual uint64_t countOfIndexedDescriptors () const noexcept=0
 Returns count of indexed descriptors. More...
 
virtual ResultValue< FSDKError,
IIDMapPtr > 
eraseRemovedDescriptors () noexcept=0
 Erases removed descriptors out of index fully. More...
 
virtual ResultValue< FSDKError,
DynamicIndexState
isValidForSearch () const noexcept=0
 Check if graph is valid for search or not. More...
 
virtual ResultValue< FSDKError,
float > 
evaluate () const noexcept=0
 Evaluate if graph is good enough for search or not. More...
 
- Public Member Functions inherited from fsdk::IDynamicDescriptorStorage
virtual ResultValue< FSDKError,
DescriptorId
appendDescriptor (const IDescriptor *descriptor) noexcept=0
 Appends descriptor to internal storage. If used on. More...
 
virtual ResultValue< FSDKError,
DescriptorId
appendBatch (const IDescriptorBatch *batch) noexcept=0
 Appends batch of descriptors to internal storage. If used on. More...
 
virtual Result< FSDKErrorremoveDescriptor (const DescriptorId index) noexcept=0
 Removes descriptor out of graph. If used on. More...
 
- Public Member Functions inherited from fsdk::IStaticDescriptorStorage
virtual Result< FSDKErrordescriptorByIndex (const DescriptorId index, IDescriptor *descriptor) const noexcept=0
 Requests descriptor data out of internal storage. More...
 
virtual uint32_t getDescriptorVersion () const noexcept=0
 Return version of stored descriptors. More...
 
virtual uint64_t size () const noexcept=0
 Return size of internal storage. More...
 
- Public Member Functions inherited from fsdk::IIndex
virtual ResultValue< FSDKError,
int > 
search (const IDescriptor *reference, int maxResultsCount, SearchResult *results) const noexcept=0
 Search for descriptors with the shorter distance to passed descriptor. More...
 
- Public Member Functions inherited from fsdk::IRefCounted
virtual int32_t retain () noexcept=0
 Increase strong reference count. More...
 
virtual int32_t retainLocked () noexcept=0
 Increase strong reference count thread safely. More...
 
virtual int32_t release () noexcept=0
 Decrease strong reference count. More...
 
virtual int32_t getRefCount () const noexcept=0
 Get actual strong reference count. More...
 
virtual int32_t retainWeak () noexcept=0
 Increase weak reference count. More...
 
virtual int32_t releaseWeak () noexcept=0
 Decrease weak reference count. More...
 
virtual int32_t getWeakRefCount () const noexcept=0
 Get actual weak reference count. More...
 

Detailed Description

Dynamic index interface.

Member Function Documentation

virtual uint64_t fsdk::IDynamicIndex::countOfIndexedDescriptors ( ) const
pure virtualnoexcept

Returns count of indexed descriptors.

You may wonder why this method exists if IDynamicIndex already inherits IStaticDescriptorStorage::size method. The reason is that

See Also
IDynamicDescriptorStorage::removeDescriptor behaves differently on
IIndexBuild and IDynamicIndex. On builder it does actually erases descriptor out of internal storage, but it does not erase it if used on IDynamicIndex. The reason is that graph data structure relies on indexes being constant, so removeDescriptor only removes it out of graph, so it is not discoverable by
IIndex::search. So this methods returns actuall data storage size minus count of removed descriptors.
Returns
Count of indexed descriptors.
virtual ResultValue<FSDKError, IIDMapPtr> fsdk::IDynamicIndex::eraseRemovedDescriptors ( )
pure virtualnoexcept

Erases removed descriptors out of index fully.

Note
Ids of other descriptors will be recalculated (moved up). 0, 1, 2 - the new ids, 0, 2, 3 - old descriptors ids, when the descriptor with id == 1 was removed
Returns
ResultValue with error code and IIDMap.
See Also
DescriptorId, ResultValue, IIDMap and FSDKError for details.
virtual ResultValue<FSDKError, float> fsdk::IDynamicIndex::evaluate ( ) const
pure virtualnoexcept

Evaluate if graph is good enough for search or not.

Note
IMPORTANT This feature is experimental. Backward compatibility is not guaranteed.
Returns
ResultValue with error code and float score in range [0..1].
See Also
ResultValue and FSDKError for details.
virtual ResultValue<FSDKError, DynamicIndexState> fsdk::IDynamicIndex::isValidForSearch ( ) const
pure virtualnoexcept

Check if graph is valid for search or not.

Note
IMPORTANT This feature is experimental. Backward compatibility is not guaranteed.
Returns
ResultValue with error code and DynamicIndexState.
See Also
DynamicIndexState, ResultValue and FSDKError for details.
virtual Result<FSDKError> fsdk::IDynamicIndex::saveToDenseIndex ( const char *  path) const
pure virtualnoexcept

Saves index as dense.

To load saved index use

See Also
IFaceEngine::loadDenseIndex method. Dense index cannot be loaded as dynamic.
Parameters
[in]pathPath to file to be created and filled with index data. Any extension is acceptable.
Returns
Result with error code.
See Also
Result and FSDKError for details.
virtual Result<FSDKError> fsdk::IDynamicIndex::saveToDynamicIndex ( const char *  path) const
pure virtualnoexcept

Saves index as dynamic.

To load saved index use

See Also
IFaceEngine::loadDynamicIndex method. Dynamic index cannot be loaded as dense. In a case of removing descriptors please call eraseRemoveDescriptors first.
Parameters
[in]pathPath to file to be created and filled with index data. Any extension is acceptable.
Returns
Result with error code.
See Also
Result, DynamicIndexState and FSDKError for details.

The documentation for this struct was generated from the following file: