// Use this for initialization void Start() { fpsMonitor = GetComponent <FpsMonitor>(); displayFacePointsToggle.isOn = displayFacePoints; displayAxesToggle.isOn = displayAxes; displayHeadToggle.isOn = displayHead; displayEffectsToggle.isOn = displayEffects; enableDownScaleToggle.isOn = enableDownScale; enableSkipFrameToggle.isOn = enableSkipFrame; enableLowPassFilterToggle.isOn = enableLowPassFilter; imageOptimizationHelper = gameObject.GetComponent <ImageOptimizationHelper>(); webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>(); dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName; #if UNITY_WEBGL && !UNITY_EDITOR getFilePath_Coroutine = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => { getFilePath_Coroutine = null; dlibShapePredictorFilePath = result; Run(); }); StartCoroutine(getFilePath_Coroutine); #else dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName); Run(); #endif }
// Use this for initialization void Start() { fpsMonitor = GetComponent <FpsMonitor> (); enableDownScaleToggle.isOn = enableDownScale; enableSkipFrameToggle.isOn = enableSkipFrame; useOpenCVFaceDetectorToggle.isOn = useOpenCVFaceDetector; imageOptimizationHelper = gameObject.GetComponent <ImageOptimizationHelper> (); webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName; #if UNITY_WEBGL && !UNITY_EDITOR getFilePath_Coroutine = GetFilePath(); StartCoroutine(getFilePath_Coroutine); #else haarcascade_frontalface_alt_xml_filepath = OpenCVForUnity.UnityUtils.Utils.getFilePath("haarcascade_frontalface_alt.xml"); dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName); Run(); #endif }