Package com.libremobileos.yifan.face
Class DirectoryFaceStorageBackend
- java.lang.Object
-
- com.libremobileos.yifan.face.FaceStorageBackend
-
- com.libremobileos.yifan.face.DirectoryFaceStorageBackend
-
public class DirectoryFaceStorageBackend extends FaceStorageBackend
FaceStorageBackendto store data in a directory. Directory must not contain files other than these created by this class!
-
-
Constructor Summary
Constructors Constructor Description DirectoryFaceStorageBackend(File dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandeleteInternal(String name)Delete all references to a face.protected StringgetInternal(String name)Load 2D face model from storage.protected Set<String>getNamesInternal()Get all known facesprotected booleanregisterInternal(String name, String data, boolean duplicate)Register/store new face.-
Methods inherited from class com.libremobileos.yifan.face.FaceStorageBackend
delete, extendRegistered, get, getNames, register, register, register
-
-
-
-
Constructor Detail
-
DirectoryFaceStorageBackend
public DirectoryFaceStorageBackend(File dir)
-
-
Method Detail
-
getNamesInternal
protected Set<String> getNamesInternal()
Description copied from class:FaceStorageBackendGet all known faces- Specified by:
getNamesInternalin classFaceStorageBackend- Returns:
Setof all known faces (names only)
-
registerInternal
protected boolean registerInternal(String name, String data, boolean duplicate)
Description copied from class:FaceStorageBackendRegister/store new face.- Specified by:
registerInternalin classFaceStorageBackend- Parameters:
name- Name of the face, needs to be unique.data- Face detection model data to store.duplicate- Only true if we are adding a duplicate and want to replace the saved one.- Returns:
- If registering was successful.
-
getInternal
protected String getInternal(String name)
Description copied from class:FaceStorageBackendLoad 2D face model from storage.- Specified by:
getInternalin classFaceStorageBackend- Parameters:
name- The name of the face to load.- Returns:
- The face model.
-
deleteInternal
protected boolean deleteInternal(String name)
Description copied from class:FaceStorageBackendDelete all references to a face.- Specified by:
deleteInternalin classFaceStorageBackend- Parameters:
name- The face to delete.- Returns:
- If deletion was successful.
-
-