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
FaceStorageBackend
to 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 boolean
deleteInternal(String name)
Delete all references to a face.protected String
getInternal(String name)
Load 2D face model from storage.protected Set<String>
getNamesInternal()
Get all known facesprotected boolean
registerInternal(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:FaceStorageBackend
Get all known faces- Specified by:
getNamesInternal
in classFaceStorageBackend
- Returns:
Set
of all known faces (names only)
-
registerInternal
protected boolean registerInternal(String name, String data, boolean duplicate)
Description copied from class:FaceStorageBackend
Register/store new face.- Specified by:
registerInternal
in 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:FaceStorageBackend
Load 2D face model from storage.- Specified by:
getInternal
in classFaceStorageBackend
- Parameters:
name
- The name of the face to load.- Returns:
- The face model.
-
deleteInternal
protected boolean deleteInternal(String name)
Description copied from class:FaceStorageBackend
Delete all references to a face.- Specified by:
deleteInternal
in classFaceStorageBackend
- Parameters:
name
- The face to delete.- Returns:
- If deletion was successful.
-
-