// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>(); isAutoResetModeToggle.isOn = isAutoResetMode; #if UNITY_WEBGL && !UNITY_EDITOR StartCoroutine(getFilePathCoroutine()); #else tracker_model_json_filepath = Utils.getFilePath("tracker_model.json"); haarcascade_frontalface_alt_xml_filepath = Utils.getFilePath("haarcascade_frontalface_alt.xml"); Run(); #endif }
private void Run() { //initialize FaceTracker faceTracker = new FaceTracker(tracker_model_json_filepath); //initialize FaceTrackerParams faceTrackerParams = new FaceTrackerParams(); cascade = new CascadeClassifier(); cascade.load(haarcascade_frontalface_alt_xml_filepath); // if (cascade.empty()) // { // Debug.LogError("cascade file is not loaded.Please copy from “FaceTrackerExample/StreamingAssets/” to “Assets/StreamingAssets/” folder. "); // } webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>(); webCamTextureToMatHelper.Init(); }
// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); isShowingFacePointsToggle.isOn = isShowingFacePoints; isShowingAxesToggle.isOn = isShowingAxes; isShowingHeadToggle.isOn = isShowingHead; isShowingEffectsToggle.isOn = isShowingEffects; isAutoResetModeToggle.isOn = isAutoResetMode; #if UNITY_WEBGL && !UNITY_EDITOR getFilePath_Coroutine = GetFilePath(); StartCoroutine(getFilePath_Coroutine); #else tracker_model_json_filepath = Utils.getFilePath("tracker_model.json"); haarcascade_frontalface_alt_xml_filepath = Utils.getFilePath("haarcascade_frontalface_alt.xml"); Run(); #endif }