Dlib FaceLandmark Detector  1.3.8
Enox Software
Static Public Member Functions | List of all members
DlibFaceLandmarkDetector.UnityUtils.Utils Class Reference

Static Public Member Functions

static string getVersion ()
 
static string getFilePath (string filepath, bool refresh=false, int timeout=0)
 
static List< string > getMultipleFilePaths (IList< string > filepaths, bool refresh=false, int timeout=0)
 
static IEnumerator getFilePathAsync (string filepath, Action< string > completed, bool refresh=false, int timeout=0)
 
static IEnumerator getFilePathAsync (string filepath, Action< string > completed, Action< string, float > progressChanged, bool refresh=false, int timeout=0)
 
static IEnumerator getFilePathAsync (string filepath, Action< string > completed, Action< string, float > progressChanged, Action< string, string, long > errorOccurred, bool refresh=false, int timeout=0)
 
static IEnumerator getMultipleFilePathsAsync (IList< string > filepaths, Action< List< string >> allCompleted, bool refresh=false, int timeout=0)
 
static IEnumerator getMultipleFilePathsAsync (IList< string > filepaths, Action< List< string >> allCompleted, Action< string > completed, bool refresh=false, int timeout=0)
 
static IEnumerator getMultipleFilePathsAsync (IList< string > filepaths, Action< List< string >> allCompleted, Action< string > completed, Action< string, float > progressChanged, bool refresh=false, int timeout=0)
 
static IEnumerator getMultipleFilePathsAsync (IList< string > filepaths, Action< List< string >> allCompleted, Action< string > completed, Action< string, float > progressChanged, Action< string, string, long > errorOccurred, bool refresh=false, int timeout=0)
 
static void setDebugMode (bool debugMode, bool throwException=false, Action< string > callback=null)
 

Member Function Documentation

◆ getFilePath()

static string DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath ( string  filepath,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the readable path of a file in the "StreamingAssets" folder.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] If the target file has not yet been copied to WebGL's virtual filesystem, you need to use getFilePathAsync() at first.

Parameters
filepatha relative file path starting from "StreamingAssets" folder.
refresh[Android] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns a readable file path in case of success and returns empty in case of error.

◆ getFilePathAsync() [1/3]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync ( string  filepath,
Action< string >  completed,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the readable path of a file in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepatha relative file path starting from the "StreamingAssets" folder.
completeda callback function that is called when the process is completed. Returns a readable file path in case of success and returns empty in case of error.
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getFilePathAsync() [2/3]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync ( string  filepath,
Action< string >  completed,
Action< string, float >  progressChanged,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the readable path of a file in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepatha relative file path starting from the "StreamingAssets" folder.
completeda callback function that is called when the process is completed. Returns a readable file path in case of success and returns empty in case of error.
progressChangeda callback function that is called when the process is the progress. Returns the file path and a progress value (0.0 to 1.0).
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getFilePathAsync() [3/3]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync ( string  filepath,
Action< string >  completed,
Action< string, float >  progressChanged,
Action< string, string, long >  errorOccurred,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the readable path of a file in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepatha relative file path starting from the "StreamingAssets" folder.
completeda callback function that is called when the process is completed. Returns a readable file path in case of success and returns empty in case of error.
progressChangeda callback function that is called when the process is the progress. Returns the file path and a progress value (0.0 to 1.0).
errorOccurreda callback function that is called when the process is error occurred. Returns the file path and an error string and an error response code.
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getMultipleFilePaths()

static List<string> DlibFaceLandmarkDetector.UnityUtils.Utils.getMultipleFilePaths ( IList< string >  filepaths,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the multiple readable paths of files in the "StreamingAssets" folder.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] If the target file has not yet been copied to WebGL's virtual filesystem, you need to use getFilePathAsync() at first.

Parameters
filepathsa list of relative file paths starting from the "StreamingAssets" folder.
refresh[Android] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns a list of readable file paths. Returns a readable file path in case of success and returns empty in case of error.

◆ getMultipleFilePathsAsync() [1/4]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getMultipleFilePathsAsync ( IList< string >  filepaths,
Action< List< string >>  allCompleted,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the multiple readable paths of files in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepathsa list of relative file paths starting from the "StreamingAssets" folder.
allCompleteda callback function that is called when all processes are completed. Returns a list of file paths. Returns a readable file path in case of success and returns empty in case of error.
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getMultipleFilePathsAsync() [2/4]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getMultipleFilePathsAsync ( IList< string >  filepaths,
Action< List< string >>  allCompleted,
Action< string >  completed,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the multiple readable paths of files in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepathsa list of relative file paths starting from the "StreamingAssets" folder.
allCompleteda callback function that is called when all processes are completed. Returns a list of file paths. Returns a readable file path in case of success and returns empty in case of error.
completeda callback function that is called when one process is completed. Returns a readable file path in case of success and returns empty in case of error.
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getMultipleFilePathsAsync() [3/4]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getMultipleFilePathsAsync ( IList< string >  filepaths,
Action< List< string >>  allCompleted,
Action< string >  completed,
Action< string, float >  progressChanged,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the multiple readable paths of files in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepathsa list of relative file paths starting from the "StreamingAssets" folder.
allCompleteda callback function that is called when all processes are completed. Returns a list of file paths. Returns a readable file path in case of success and returns empty in case of error.
completeda callback function that is called when one process is completed. Returns a readable file path in case of success and returns empty in case of error.
progressChangeda callback function that is called when one process is the progress. Returns the file path and a progress value (0.0 to 1.0).
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getMultipleFilePathsAsync() [4/4]

static IEnumerator DlibFaceLandmarkDetector.UnityUtils.Utils.getMultipleFilePathsAsync ( IList< string >  filepaths,
Action< List< string >>  allCompleted,
Action< string >  completed,
Action< string, float >  progressChanged,
Action< string, string, long >  errorOccurred,
bool  refresh = false,
int  timeout = 0 
)
static

Gets the multiple readable paths of files in the "StreamingAssets" folder by using coroutines.


Set a relative file path from the starting point of the "StreamingAssets" folder. e.g. "foobar.txt" or "hogehoge/foobar.txt".
[Android] The target file that exists in the "StreamingAssets" folder is copied into the folder of the Application.persistentDataPath. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
[WebGL] The target file in the "StreamingAssets" folder is copied to the WebGL's virtual filesystem. If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.

Parameters
filepathsa list of relative file paths starting from the "StreamingAssets" folder.
allCompleteda callback function that is called when all processes are completed. Returns a list of file paths. Returns a readable file path in case of success and returns empty in case of error.
completeda callback function that is called when one process is completed. Returns a readable file path in case of success and returns empty in case of error.
progressChangeda callback function that is called when one process is the progress. Returns the file path and a progress value (0.0 to 1.0).
errorOccurreda callback function that is called when one process is error occurred. Returns the file path and an error string and an error response code.
refresh[Android][WebGL] If refresh flag is false, when the file has already been copied, the file is not copied. If refresh flag is true, the file is always copied.
timeout[Android 2017.1+][WebGL] Sets UnityWebRequest to attempt to abort after the number of seconds in timeout has passed. No timeout is applied when timeout is set to 0 and this property defaults to 0.
Returns
returns an IEnumerator object. Yielding the IEnumerator inside a coroutine will cause the coroutine to pause until the UnityWebRequest encounters a system error or finishes communicating.

◆ getVersion()

static string DlibFaceLandmarkDetector.UnityUtils.Utils.getVersion ( )
static

Returns this "Dlib FaceLandmark Detector" version number.

Returns
this "Dlib FaceLandmark Detector" version number

◆ setDebugMode()

static void DlibFaceLandmarkDetector.UnityUtils.Utils.setDebugMode ( bool  debugMode,
bool  throwException = false,
Action< string >  callback = null 
)
static

Sets the debug mode.


if debugMode is true, The error log of the Native side OpenCV will be displayed on the Unity Editor Console.However, if throwException is true, CvException is thrown instead of calling Debug.LogError (msg).
Please use as follows.
Utils.setDebugMode(true);
aaa
bbb
ccc
Utils.setDebugMode(false);

Parameters
debugModeif true, The error log of the Native side OpenCV will be displayed on the Unity Editor Console.
throwExceptionif true, CvException is thrown instead of calling Debug.LogError (msg).
callbackcallback called when an OpenCV error occurs on the Native side.

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