├── Assets ├── DlibFaceLandmarkDetector.meta ├── DlibFaceLandmarkDetector │ ├── DlibLicense.txt │ ├── DlibLicense.txt.meta │ ├── EnoxSoftware.DlibFaceLandmarkDetector.asmdef │ ├── EnoxSoftware.DlibFaceLandmarkDetector.asmdef.meta │ ├── Examples.meta │ ├── Examples │ │ ├── BenchmarkExample.meta │ │ ├── BenchmarkExample │ │ │ ├── BenchmarkExample.cs │ │ │ ├── BenchmarkExample.cs.meta │ │ │ ├── BenchmarkExample.unity │ │ │ └── BenchmarkExample.unity.meta │ │ ├── CatDetectionExample.meta │ │ ├── CatDetectionExample │ │ │ ├── CatDetectionExample.cs │ │ │ ├── CatDetectionExample.cs.meta │ │ │ ├── CatDetectionExample.unity │ │ │ └── CatDetectionExample.unity.meta │ │ ├── DlibFaceLandmarkDetectorExample.cs │ │ ├── DlibFaceLandmarkDetectorExample.cs.meta │ │ ├── DlibFaceLandmarkDetectorExample.unity │ │ ├── DlibFaceLandmarkDetectorExample.unity.meta │ │ ├── EnoxSoftware.DlibFaceLandmarkDetectorExample.asmdef │ │ ├── EnoxSoftware.DlibFaceLandmarkDetectorExample.asmdef.meta │ │ ├── ExampleMaterial.mat │ │ ├── ExampleMaterial.mat.meta │ │ ├── LoadingIcon.png │ │ ├── LoadingIcon.png.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── benchmark_image_large.png │ │ │ ├── benchmark_image_large.png.meta │ │ │ ├── benchmark_image_small.png │ │ │ ├── benchmark_image_small.png.meta │ │ │ ├── cat.jpg │ │ │ ├── cat.jpg.meta │ │ │ ├── face.jpg │ │ │ ├── face.jpg.meta │ │ │ ├── family.png │ │ │ └── family.png.meta │ │ ├── ShowSystemInfo.cs │ │ ├── ShowSystemInfo.cs.meta │ │ ├── ShowSystemInfo.unity │ │ ├── ShowSystemInfo.unity.meta │ │ ├── Texture2DExample.meta │ │ ├── Texture2DExample │ │ │ ├── Texture2DExample.cs │ │ │ ├── Texture2DExample.cs.meta │ │ │ ├── Texture2DExample.unity │ │ │ └── Texture2DExample.unity.meta │ │ ├── Utils.meta │ │ ├── Utils │ │ │ ├── FpsMonitor.meta │ │ │ ├── FpsMonitor │ │ │ │ ├── FpsMonitor.cs │ │ │ │ ├── FpsMonitor.cs.meta │ │ │ │ ├── Resources.meta │ │ │ │ └── Resources │ │ │ │ │ ├── FpsMonitorCanvas_103.prefab │ │ │ │ │ └── FpsMonitorCanvas_103.prefab.meta │ │ │ ├── InputModuleSwitcher.cs │ │ │ ├── InputModuleSwitcher.cs.meta │ │ │ ├── TouchController.cs │ │ │ └── TouchController.cs.meta │ │ ├── WebCamTextureExample.meta │ │ ├── WebCamTextureExample │ │ │ ├── WebCamTextureExample.cs │ │ │ ├── WebCamTextureExample.cs.meta │ │ │ ├── WebCamTextureExample.unity │ │ │ └── WebCamTextureExample.unity.meta │ │ ├── link.xml │ │ └── link.xml.meta │ ├── Notices.txt │ ├── Notices.txt.meta │ ├── ReadMe.pdf │ └── ReadMe.pdf.meta ├── DlibFaceLandmarkDetectorWithOpenCVExample.meta └── DlibFaceLandmarkDetectorWithOpenCVExample │ ├── ARHeadExample.meta │ ├── ARHeadExample │ ├── AR.meta │ ├── AR │ │ ├── EyeLaser.meta │ │ ├── EyeLaser │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── eff_glitter_2.mat │ │ │ │ ├── eff_glitter_2.mat.meta │ │ │ │ ├── eff_par_1.mat │ │ │ │ ├── eff_par_1.mat.meta │ │ │ │ ├── eff_smoke_2.mat │ │ │ │ └── eff_smoke_2.mat.meta │ │ │ ├── Prefab.meta │ │ │ ├── Prefab │ │ │ │ ├── Eff_Laser_2.prefab │ │ │ │ └── Eff_Laser_2.prefab.meta │ │ │ ├── Textures.meta │ │ │ └── Textures │ │ │ │ ├── Eff_Glitter2.png │ │ │ │ ├── Eff_Glitter2.png.meta │ │ │ │ ├── Eff_smoke_1.png │ │ │ │ ├── Eff_smoke_1.png.meta │ │ │ │ ├── eff_par_1.tga │ │ │ │ └── eff_par_1.tga.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── axes_x_material_Built-in.mat │ │ │ ├── axes_x_material_Built-in.mat.meta │ │ │ ├── axes_x_material_SRP.mat │ │ │ ├── axes_x_material_SRP.mat.meta │ │ │ ├── axes_y_material_Built-in.mat │ │ │ ├── axes_y_material_Built-in.mat.meta │ │ │ ├── axes_y_material_SRP.mat │ │ │ ├── axes_y_material_SRP.mat.meta │ │ │ ├── axes_z_material_Built-in.mat │ │ │ ├── axes_z_material_Built-in.mat.meta │ │ │ ├── axes_z_material_SRP.mat │ │ │ ├── axes_z_material_SRP.mat.meta │ │ │ ├── head_material_Built-in.mat │ │ │ ├── head_material_Built-in.mat.meta │ │ │ ├── head_material_SRP.mat │ │ │ ├── head_material_SRP.mat.meta │ │ │ ├── quad_material.mat │ │ │ └── quad_material.mat.meta │ │ ├── MouthLaser.meta │ │ ├── MouthLaser │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── eff_heart_1.mat │ │ │ │ └── eff_heart_1.mat.meta │ │ │ ├── Prefab.meta │ │ │ ├── Prefab │ │ │ │ ├── Eff_Laser_5.prefab │ │ │ │ └── Eff_Laser_5.prefab.meta │ │ │ ├── Textures.meta │ │ │ └── Textures │ │ │ │ ├── Eff_Heart_1.png │ │ │ │ └── Eff_Heart_1.png.meta │ │ ├── Prefabs.meta │ │ └── Prefabs │ │ │ ├── Axes_X.prefab │ │ │ ├── Axes_X.prefab.meta │ │ │ ├── Axes_Y.prefab │ │ │ ├── Axes_Y.prefab.meta │ │ │ ├── Axes_Z.prefab │ │ │ ├── Axes_Z.prefab.meta │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ ├── unnamed.mat │ │ │ └── unnamed.mat.meta │ │ │ ├── human_male.fbx │ │ │ └── human_male.fbx.meta │ ├── MultiSourceARHeadExample.cs │ ├── MultiSourceARHeadExample.cs.meta │ ├── VideoCaptureARHeadExample_Built-in.unity │ ├── VideoCaptureARHeadExample_Built-in.unity.meta │ ├── VideoCaptureARHeadExample_SRP.unity │ ├── VideoCaptureARHeadExample_SRP.unity.meta │ ├── WebCamTextureARHeadExample_Built-in.unity │ ├── WebCamTextureARHeadExample_Built-in.unity.meta │ ├── WebCamTextureARHeadExample_SRP.unity │ └── WebCamTextureARHeadExample_SRP.unity.meta │ ├── EnoxSoftware.DlibFaceLandmarkDetectorWithOpenCVExample.asmdef │ ├── EnoxSoftware.DlibFaceLandmarkDetectorWithOpenCVExample.asmdef.meta │ ├── ExampleMaterial.mat │ ├── ExampleMaterial.mat.meta │ ├── FrameOptimizationExample.meta │ ├── FrameOptimizationExample │ ├── FrameOptimizationExample.cs │ ├── FrameOptimizationExample.cs.meta │ ├── FrameOptimizationExample.unity │ └── FrameOptimizationExample.unity.meta │ ├── LoadingIcon.png │ ├── LoadingIcon.png.meta │ ├── MultiSource2MatHelperExample.meta │ ├── MultiSource2MatHelperExample │ ├── MultiSource2MatHelperExample.cs │ ├── MultiSource2MatHelperExample.cs.meta │ ├── VideoCapture2MatHelperExample.unity │ ├── VideoCapture2MatHelperExample.unity.meta │ ├── WebCamTexture2MatHelperExample.unity │ └── WebCamTexture2MatHelperExample.unity.meta │ ├── NoiseFilterExample.meta │ ├── NoiseFilterExample │ ├── MultiSourceNoiseFilterExample.cs │ ├── MultiSourceNoiseFilterExample.cs.meta │ ├── NoiseFilter.meta │ ├── NoiseFilter │ │ ├── KFPointsFilter.cs │ │ ├── KFPointsFilter.cs.meta │ │ ├── LowPassPointsFilter.cs │ │ ├── LowPassPointsFilter.cs.meta │ │ ├── OFPointsFilter.cs │ │ ├── OFPointsFilter.cs.meta │ │ ├── PointsFilterBase.cs │ │ └── PointsFilterBase.cs.meta │ ├── VideoCaptureNoiseFilterExample.unity │ ├── VideoCaptureNoiseFilterExample.unity.meta │ ├── WebCamTextureNoiseFilterExample.unity │ └── WebCamTextureNoiseFilterExample.unity.meta │ ├── OpenCVForUnityUtils.cs │ ├── OpenCVForUnityUtils.cs.meta │ ├── ShowLicense.cs │ ├── ShowLicense.cs.meta │ ├── ShowLicense.unity │ ├── ShowLicense.unity.meta │ ├── Texture2DToMatExample.meta │ ├── Texture2DToMatExample │ ├── Texture2DToMatExample.cs │ ├── Texture2DToMatExample.cs.meta │ ├── Texture2DToMatExample.unity │ └── Texture2DToMatExample.unity.meta │ ├── Utils.meta │ └── Utils │ ├── FpsMonitor.meta │ ├── FpsMonitor │ ├── FpsMonitor.cs │ ├── FpsMonitor.cs.meta │ ├── Resources.meta │ └── Resources │ │ ├── FpsMonitorCanvas_103.prefab │ │ └── FpsMonitorCanvas_103.prefab.meta │ ├── InputModuleSwitcher.cs │ ├── InputModuleSwitcher.cs.meta │ ├── TouchController.cs │ └── TouchController.cs.meta └── README.md /Assets/DlibFaceLandmarkDetector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cad3b29bd0ad0b419633f67a0198273 3 | folderAsset: yes 4 | timeCreated: 1460557717 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/DlibLicense.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/DlibLicense.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce43373fc02bf0d41a63c54958f810e1 3 | timeCreated: 1531911535 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/EnoxSoftware.DlibFaceLandmarkDetector.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EnoxSoftware.DlibFaceLandmarkDetector", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": true, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [], 11 | "versionDefines": [], 12 | "noEngineReferences": false 13 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/EnoxSoftware.DlibFaceLandmarkDetector.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7166fda719c99694d9297ead935e2a9d 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65639e7e41c0da94aaf9cd09e0134076 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/BenchmarkExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 380f1978c0937a24a96075251c940b04 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/BenchmarkExample/BenchmarkExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 029a69d2775e26c4d947b9106bd1c039 3 | timeCreated: 1547467264 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/BenchmarkExample/BenchmarkExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a06413d2e8e9de4ea2b4f41f72d5836 3 | timeCreated: 1547467264 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/CatDetectionExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a347262af0949c341b91647031e2095b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/CatDetectionExample/CatDetectionExample.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector; 2 | using DlibFaceLandmarkDetector.UnityUtils; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using UnityEngine; 8 | using UnityEngine.SceneManagement; 9 | using UnityEngine.UI; 10 | 11 | namespace DlibFaceLandmarkDetectorExample 12 | { 13 | /// 14 | /// Cat Detection Example 15 | /// An example of detecting cat face landmarks in a Texture2D image. 16 | /// 17 | public class CatDetectionExample : MonoBehaviour 18 | { 19 | [Header("Output")] 20 | /// 21 | /// The RawImage for previewing the result. 22 | /// 23 | public RawImage resultPreview; 24 | 25 | [Space(10)] 26 | 27 | /// 28 | /// The texture2D. 29 | /// 30 | public Texture2D texture2D; 31 | 32 | /// 33 | /// The FPS monitor. 34 | /// 35 | FpsMonitor fpsMonitor; 36 | 37 | /// 38 | /// OBJECT_DETECTOR_FILENAME 39 | /// 40 | protected static readonly string OBJECT_DETECTOR_FILENAME = "DlibFaceLandmarkDetector/frontal_cat_face.svm"; 41 | 42 | /// 43 | /// The object_detector_filepath. 44 | /// 45 | string object_detector_filepath; 46 | 47 | /// 48 | /// SHAPE_PREDICTOR_FILENAME 49 | /// 50 | protected static readonly string SHAPE_PREDICTOR_FILENAME = "DlibFaceLandmarkDetector/sp_cat_face_68.dat"; 51 | 52 | /// 53 | /// The shape_predictor_filepath. 54 | /// 55 | string shape_predictor_filepath; 56 | 57 | /// 58 | /// The CancellationTokenSource. 59 | /// 60 | CancellationTokenSource cts = new CancellationTokenSource(); 61 | 62 | // Use this for initialization 63 | async void Start() 64 | { 65 | fpsMonitor = GetComponent(); 66 | 67 | // Asynchronously retrieves the readable file path from the StreamingAssets directory. 68 | if (fpsMonitor != null) 69 | fpsMonitor.consoleText = "Preparing file access..."; 70 | 71 | object_detector_filepath = await Utils.getFilePathAsyncTask(OBJECT_DETECTOR_FILENAME, cancellationToken: cts.Token); 72 | shape_predictor_filepath = await Utils.getFilePathAsyncTask(SHAPE_PREDICTOR_FILENAME, cancellationToken: cts.Token); 73 | 74 | if (fpsMonitor != null) 75 | fpsMonitor.consoleText = ""; 76 | 77 | Run(); 78 | } 79 | 80 | private void Run() 81 | { 82 | if (string.IsNullOrEmpty(object_detector_filepath)) 83 | { 84 | Debug.LogError("object detecter file does not exist. Please copy from “DlibFaceLandmarkDetector/StreamingAssets/DlibFaceLandmarkDetector/” to “Assets/StreamingAssets/DlibFaceLandmarkDetector/” folder. "); 85 | } 86 | if (string.IsNullOrEmpty(shape_predictor_filepath)) 87 | { 88 | Debug.LogError("shape predictor file does not exist. Please copy from “DlibFaceLandmarkDetector/StreamingAssets/DlibFaceLandmarkDetector/” to “Assets/StreamingAssets/DlibFaceLandmarkDetector/” folder. "); 89 | } 90 | 91 | Texture2D dstTexture2D = new Texture2D(texture2D.width, texture2D.height, texture2D.format, false); 92 | dstTexture2D.SetPixels32(texture2D.GetPixels32()); 93 | dstTexture2D.Apply(); 94 | 95 | FaceLandmarkDetector faceLandmarkDetector = new FaceLandmarkDetector(object_detector_filepath, shape_predictor_filepath); 96 | faceLandmarkDetector.SetImage(texture2D); 97 | 98 | //detect face rects 99 | List detectResult = faceLandmarkDetector.Detect(); 100 | 101 | foreach (var rect in detectResult) 102 | { 103 | Debug.Log("face : " + rect); 104 | 105 | //detect landmark points 106 | List points = faceLandmarkDetector.DetectLandmark(rect); 107 | 108 | Debug.Log("face points count : " + points.Count); 109 | foreach (var point in points) 110 | { 111 | Debug.Log("face point : x " + point.x + " y " + point.y); 112 | } 113 | 114 | //draw landmark points 115 | faceLandmarkDetector.DrawDetectLandmarkResult(dstTexture2D, 0, 255, 0, 255); 116 | } 117 | 118 | //draw face rects 119 | faceLandmarkDetector.DrawDetectResult(dstTexture2D, 255, 0, 0, 255, 3); 120 | 121 | faceLandmarkDetector.Dispose(); 122 | 123 | resultPreview.texture = dstTexture2D; 124 | resultPreview.GetComponent().aspectRatio = (float)dstTexture2D.width / dstTexture2D.height; 125 | 126 | 127 | if (fpsMonitor != null) 128 | { 129 | fpsMonitor.Add("dlib object detector", "frontal_cat_face.svm"); 130 | fpsMonitor.Add("dlib shape predictor", "sp_cat_face_68.dat"); 131 | fpsMonitor.Add("width", dstTexture2D.width.ToString()); 132 | fpsMonitor.Add("height", dstTexture2D.height.ToString()); 133 | fpsMonitor.Add("orientation", Screen.orientation.ToString()); 134 | } 135 | } 136 | 137 | // Update is called once per frame 138 | void Update() 139 | { 140 | 141 | } 142 | 143 | /// 144 | /// Raises the destroy event. 145 | /// 146 | void OnDestroy() 147 | { 148 | if (cts != null) 149 | cts.Dispose(); 150 | } 151 | 152 | /// 153 | /// Raises the back button click event. 154 | /// 155 | public void OnBackButtonClick() 156 | { 157 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 158 | } 159 | } 160 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/CatDetectionExample/CatDetectionExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a59befc045462d34d817f0b9148067c0 3 | timeCreated: 1462530675 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/CatDetectionExample/CatDetectionExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c173eaaeba2da1408c7057b72cf8441 3 | timeCreated: 1462530674 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/DlibFaceLandmarkDetectorExample.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector.UnityUtils; 2 | using UnityEngine; 3 | using UnityEngine.Rendering; 4 | using UnityEngine.SceneManagement; 5 | using UnityEngine.UI; 6 | 7 | namespace DlibFaceLandmarkDetectorExample 8 | { 9 | public class DlibFaceLandmarkDetectorExample : MonoBehaviour 10 | { 11 | public Text versionInfo; 12 | public ScrollRect scrollRect; 13 | static float verticalNormalizedPosition = 1f; 14 | 15 | 16 | public enum DlibShapePredictorNamePreset : int 17 | { 18 | sp_human_face_68, 19 | sp_human_face_68_for_mobile, 20 | sp_human_face_17, 21 | sp_human_face_17_for_mobile, 22 | sp_human_face_6, 23 | } 24 | 25 | public Dropdown dlibShapePredictorNameDropdown; 26 | 27 | static DlibShapePredictorNamePreset dlibShapePredictorName = DlibShapePredictorNamePreset.sp_human_face_68; 28 | 29 | /// 30 | /// The name of dlib shape predictor file to use in the example scenes. 31 | /// 32 | public static string dlibShapePredictorFileName 33 | { 34 | get 35 | { 36 | return "DlibFaceLandmarkDetector/" + dlibShapePredictorName.ToString() + ".dat"; 37 | } 38 | } 39 | 40 | // Use this for initialization 41 | void Start() 42 | { 43 | versionInfo.text = "dlibfacelandmarkdetector" + " " + Utils.getVersion(); 44 | versionInfo.text += " / UnityEditor " + Application.unityVersion; 45 | versionInfo.text += " / "; 46 | 47 | #if UNITY_EDITOR 48 | versionInfo.text += "Editor"; 49 | #elif UNITY_STANDALONE_WIN 50 | versionInfo.text += "Windows"; 51 | #elif UNITY_STANDALONE_OSX 52 | versionInfo.text += "Mac OSX"; 53 | #elif UNITY_STANDALONE_LINUX 54 | versionInfo.text += "Linux"; 55 | #elif UNITY_ANDROID 56 | versionInfo.text += "Android"; 57 | #elif UNITY_IOS 58 | versionInfo.text += "iOS"; 59 | #elif UNITY_WSA 60 | versionInfo.text += "WSA"; 61 | #elif UNITY_WEBGL 62 | versionInfo.text += "WebGL"; 63 | #endif 64 | versionInfo.text += " "; 65 | #if ENABLE_MONO 66 | versionInfo.text += "Mono"; 67 | #elif ENABLE_IL2CPP 68 | versionInfo.text += "IL2CPP"; 69 | #elif ENABLE_DOTNET 70 | versionInfo.text += ".NET"; 71 | #endif 72 | 73 | scrollRect.verticalNormalizedPosition = verticalNormalizedPosition; 74 | 75 | dlibShapePredictorNameDropdown.value = (int)dlibShapePredictorName; 76 | } 77 | 78 | // Update is called once per frame 79 | void Update() 80 | { 81 | 82 | } 83 | 84 | public void OnScrollRectValueChanged() 85 | { 86 | verticalNormalizedPosition = scrollRect.verticalNormalizedPosition; 87 | } 88 | 89 | 90 | public void OnShowSystemInfoButtonClick() 91 | { 92 | SceneManager.LoadScene("ShowSystemInfo"); 93 | } 94 | 95 | public void OnTexture2DExampleButtonClick() 96 | { 97 | SceneManager.LoadScene("Texture2DExample"); 98 | } 99 | 100 | public void OnWebCamTextureExampleButtonClick() 101 | { 102 | SceneManager.LoadScene("WebCamTextureExample"); 103 | } 104 | 105 | public void OnCatDetectionExampleButtonClick() 106 | { 107 | SceneManager.LoadScene("CatDetectionExample"); 108 | } 109 | 110 | public void OnBenchmarkExampleButtonClick() 111 | { 112 | SceneManager.LoadScene("BenchmarkExample"); 113 | } 114 | 115 | 116 | 117 | public void OnShowLicenseButtonClick() 118 | { 119 | SceneManager.LoadScene("ShowLicense"); 120 | } 121 | 122 | public void OnTexture2DToMatExampleButtonClick() 123 | { 124 | SceneManager.LoadScene("Texture2DToMatExample"); 125 | } 126 | 127 | public void OnWebCamTexture2MatHelperExampleButtonClick() 128 | { 129 | SceneManager.LoadScene("WebCamTexture2MatHelperExample"); 130 | } 131 | 132 | public void OnVideoCapture2MatHelperExampleButtonClick() 133 | { 134 | SceneManager.LoadScene("VideoCapture2MatHelperExample"); 135 | } 136 | 137 | public void OnWebCamTextureARHeadExampleButtonClick() 138 | { 139 | if (GraphicsSettings.defaultRenderPipeline == null) 140 | { 141 | SceneManager.LoadScene("WebCamTextureARHeadExample_Built-in"); 142 | } 143 | else 144 | { 145 | SceneManager.LoadScene("WebCamTextureARHeadExample_SRP"); 146 | } 147 | } 148 | 149 | public void OnVideoCaptureARHeadExampleButtonClick() 150 | { 151 | if (GraphicsSettings.defaultRenderPipeline == null) 152 | { 153 | SceneManager.LoadScene("VideoCaptureARHeadExample_Built-in"); 154 | } 155 | else 156 | { 157 | SceneManager.LoadScene("VideoCaptureARHeadExample_SRP"); 158 | } 159 | } 160 | 161 | public void OnFrameOptimizationExampleButtonClick() 162 | { 163 | SceneManager.LoadScene("FrameOptimizationExample"); 164 | } 165 | 166 | public void OnWebCamTextureNoiseFilterExampleButtonClick() 167 | { 168 | SceneManager.LoadScene("WebCamTextureNoiseFilterExample"); 169 | } 170 | 171 | public void OnVideoCaptureNoiseFilterExampleButtonClick() 172 | { 173 | SceneManager.LoadScene("VideoCaptureNoiseFilterExample"); 174 | } 175 | 176 | 177 | /// 178 | /// Raises the dlib shape predictor name dropdown value changed event. 179 | /// 180 | public void OnDlibShapePredictorNameDropdownValueChanged(int result) 181 | { 182 | dlibShapePredictorName = (DlibShapePredictorNamePreset)result; 183 | } 184 | } 185 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/DlibFaceLandmarkDetectorExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f490634625317c545b5e7d48aac913af 3 | timeCreated: 1461439312 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/DlibFaceLandmarkDetectorExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f14b07666e9ee894fac7f94624ef302d 3 | timeCreated: 1461439312 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/EnoxSoftware.DlibFaceLandmarkDetectorExample.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EnoxSoftware.DlibFaceLandmarkDetectorExample", 3 | "rootNamespace": "", 4 | "references": [ 5 | "EnoxSoftware.DlibFaceLandmarkDetector", 6 | "Unity.InputSystem" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": true, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/EnoxSoftware.DlibFaceLandmarkDetectorExample.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffc1fa445a7832149a66ac36298c97ac 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/ExampleMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ExampleMaterial 10 | m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 2639e6dea8386244db10423fbefae982, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/ExampleMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82cedaac19e0a3e40a59d980c2efc68e 3 | timeCreated: 1461439312 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/LoadingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/LoadingIcon.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/LoadingIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2639e6dea8386244db10423fbefae982 3 | timeCreated: 1479410294 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 512 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 0 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 0 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cace15390dd4dd64caf77bb4c5de64de 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_large.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_large.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4eddcc316c98db64abfc30652c4f1dd6 3 | timeCreated: 1547483634 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 1024 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 1 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 1024 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 1 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 1024 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 1 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 1024 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 1 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 1024 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 1 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_small.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/benchmark_image_small.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d650bf66dd6f3e444a14dfe95ab29b09 3 | timeCreated: 1547483634 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 1024 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 1024 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 1024 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 1024 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 1024 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/Resources/cat.jpg -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/cat.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02f4f480b973f9748904cc7123edba99 3 | timeCreated: 1462821508 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 4 30 | maxTextureSize: 1024 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 5 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/Resources/face.jpg -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/face.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10f9e7382298b7847bca861a899f738b 3 | timeCreated: 1594897092 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 1 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: -1 37 | wrapV: -1 38 | wrapW: -1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 1024 60 | textureFormat: -1 61 | textureCompression: 0 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 1024 68 | textureFormat: -1 69 | textureCompression: 0 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: Android 75 | maxTextureSize: 1024 76 | textureFormat: -1 77 | textureCompression: 0 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | spriteSheet: 83 | serializedVersion: 2 84 | sprites: [] 85 | outline: [] 86 | physicsShape: [] 87 | spritePackingTag: 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/family.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/Examples/Resources/family.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Resources/family.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a1104c708dd5324ea04ed6e0da67610 3 | timeCreated: 1461853434 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 4 30 | maxTextureSize: 1024 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 5 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/ShowSystemInfo.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector.UnityUtils; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.SceneManagement; 8 | using UnityEngine.UI; 9 | 10 | namespace DlibFaceLandmarkDetectorExample 11 | { 12 | public class ShowSystemInfo : MonoBehaviour 13 | { 14 | public Text systemInfoText; 15 | public InputField systemInfoInputField; 16 | 17 | private const string ASSET_NAME = "DlibFaceLandmarkDetector"; 18 | 19 | // Use this for initialization 20 | void Start() 21 | { 22 | 23 | StringBuilder sb = new StringBuilder(); 24 | sb.Append("###### Build Info ######\n"); 25 | IDictionary buildInfo = GetBuildInfo(); 26 | foreach (string key in buildInfo.Keys) 27 | { 28 | sb.Append(key).Append(" = ").Append(buildInfo[key]).Append("\n"); 29 | } 30 | sb.Append("\n"); 31 | 32 | #if UNITY_IOS || (UNITY_ANDROID && UNITY_2018_3_OR_NEWER) 33 | sb.Append("###### Device Info ######\n"); 34 | IDictionary deviceInfo = GetDeviceInfo(); 35 | foreach (string key in deviceInfo.Keys) 36 | { 37 | sb.Append(key).Append(" = ").Append(deviceInfo[key]).Append("\n"); 38 | } 39 | sb.Append("\n"); 40 | #endif 41 | 42 | sb.Append("###### System Info ######\n"); 43 | IDictionary systemInfo = GetSystemInfo(); 44 | foreach (string key in systemInfo.Keys) 45 | { 46 | sb.Append(key).Append(" = ").Append(systemInfo[key]).Append("\n"); 47 | } 48 | sb.Append("#########################\n"); 49 | 50 | systemInfoText.text = systemInfoInputField.text = sb.ToString(); 51 | Debug.Log(sb.ToString()); 52 | } 53 | 54 | // Update is called once per frame 55 | void Update() 56 | { 57 | 58 | } 59 | 60 | public Dictionary GetBuildInfo() 61 | { 62 | Dictionary dict = new Dictionary(); 63 | 64 | dict.Add(ASSET_NAME + " version", Utils.getVersion()); 65 | dict.Add("Build Unity version", Application.unityVersion); 66 | 67 | #if UNITY_EDITOR 68 | dict.Add("Build target", "Editor"); 69 | #elif UNITY_STANDALONE_WIN 70 | dict.Add("Build target", "Windows"); 71 | #elif UNITY_STANDALONE_OSX 72 | dict.Add("Build target", "Mac OSX"); 73 | #elif UNITY_STANDALONE_LINUX 74 | dict.Add("Build target", "Linux"); 75 | #elif UNITY_ANDROID 76 | dict.Add("Build target", "Android"); 77 | #elif UNITY_IOS 78 | dict.Add("Build target", "iOS"); 79 | #elif UNITY_WSA 80 | dict.Add("Build target", "WSA"); 81 | #elif UNITY_WEBGL 82 | dict.Add("Build target", "WebGL"); 83 | #else 84 | dict.Add("Build target", ""); 85 | #endif 86 | 87 | #if ENABLE_MONO 88 | dict.Add("Scripting backend", "Mono"); 89 | #elif ENABLE_IL2CPP 90 | dict.Add("Scripting backend", "IL2CPP"); 91 | #elif ENABLE_DOTNET 92 | dict.Add("Scripting backend", ".NET"); 93 | #else 94 | dict.Add("Scripting backend", ""); 95 | #endif 96 | 97 | #if !DLIB_DONT_USE_UNSAFE_CODE 98 | dict.Add("Allow 'unsafe' Code", "Enabled"); 99 | #else 100 | dict.Add("Allow 'unsafe' Code", "Disabled"); 101 | #endif 102 | 103 | return dict; 104 | } 105 | 106 | public Dictionary GetDeviceInfo() 107 | { 108 | Dictionary dict = new Dictionary(); 109 | 110 | #if UNITY_IOS 111 | dict.Add("iOS.Device.generation", UnityEngine.iOS.Device.generation.ToString()); 112 | dict.Add("iOS.Device.systemVersion", UnityEngine.iOS.Device.systemVersion.ToString()); 113 | #endif 114 | #if UNITY_IOS && UNITY_2018_1_OR_NEWER 115 | dict.Add("UserAuthorization.WebCam", Application.HasUserAuthorization(UserAuthorization.WebCam).ToString()); 116 | dict.Add("UserAuthorization.Microphone", Application.HasUserAuthorization(UserAuthorization.Microphone).ToString()); 117 | #endif 118 | #if UNITY_ANDROID && UNITY_2018_3_OR_NEWER 119 | dict.Add("Android.Permission.Camera", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.Camera).ToString()); 120 | dict.Add("Android.Permission.CoarseLocation", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.CoarseLocation).ToString()); 121 | dict.Add("Android.Permission.ExternalStorageRead", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.ExternalStorageRead).ToString()); 122 | dict.Add("Android.Permission.ExternalStorageWrite", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.ExternalStorageWrite).ToString()); 123 | dict.Add("Android.Permission.FineLocation", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.FineLocation).ToString()); 124 | dict.Add("Android.Permission.Microphone", UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.Microphone).ToString()); 125 | #endif 126 | 127 | return dict; 128 | } 129 | 130 | /// SystemInfo Class Propertys 131 | public SortedDictionary GetSystemInfo() 132 | { 133 | SortedDictionary dict = new SortedDictionary(); 134 | 135 | Type type = typeof(SystemInfo); 136 | MemberInfo[] members = type.GetMembers( 137 | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); 138 | 139 | foreach (MemberInfo mb in members) 140 | { 141 | try 142 | { 143 | if (mb.MemberType == MemberTypes.Property) 144 | { 145 | if (mb.Name == "deviceUniqueIdentifier") 146 | { 147 | dict.Add(mb.Name, "xxxxxxxxxxxxxxxxxxxxxxxx"); 148 | continue; 149 | } 150 | 151 | PropertyInfo pr = type.GetProperty(mb.Name); 152 | 153 | if (pr != null) 154 | { 155 | object resobj = pr.GetValue(type, null); 156 | dict.Add(mb.Name, resobj.ToString()); 157 | } 158 | else 159 | { 160 | dict.Add(mb.Name, ""); 161 | } 162 | } 163 | } 164 | catch (Exception e) 165 | { 166 | Debug.Log("Exception: " + e); 167 | } 168 | } 169 | 170 | return dict; 171 | } 172 | 173 | public void OnBackButtonClick() 174 | { 175 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 176 | } 177 | } 178 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/ShowSystemInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65e9ea194865bdd44beecbde6ded985f 3 | timeCreated: 1522874906 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/ShowSystemInfo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 505339b443d9bea4895ad7a35ac6be25 3 | timeCreated: 1522874905 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Texture2DExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f78c887814bab2f408b9aa7afcd6d30b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Texture2DExample/Texture2DExample.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector; 2 | using DlibFaceLandmarkDetector.UnityUtils; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using UnityEngine; 8 | using UnityEngine.SceneManagement; 9 | using UnityEngine.UI; 10 | 11 | namespace DlibFaceLandmarkDetectorExample 12 | { 13 | /// 14 | /// Texture2D Example 15 | /// An example of detecting face landmarks in a Texture2D image. 16 | /// 17 | public class Texture2DExample : MonoBehaviour 18 | { 19 | [Header("Output")] 20 | /// 21 | /// The RawImage for previewing the result. 22 | /// 23 | public RawImage resultPreview; 24 | 25 | [Space(10)] 26 | 27 | /// 28 | /// The texture2D. 29 | /// 30 | public Texture2D texture2D; 31 | 32 | /// 33 | /// The FPS monitor. 34 | /// 35 | FpsMonitor fpsMonitor; 36 | 37 | /// 38 | /// The dlib shape predictor file name. 39 | /// 40 | string dlibShapePredictorFileName = "DlibFaceLandmarkDetector/sp_human_face_68.dat"; 41 | 42 | /// 43 | /// The dlib shape predictor file path. 44 | /// 45 | string dlibShapePredictorFilePath; 46 | 47 | /// 48 | /// The CancellationTokenSource. 49 | /// 50 | CancellationTokenSource cts = new CancellationTokenSource(); 51 | 52 | // Use this for initialization 53 | async void Start() 54 | { 55 | fpsMonitor = GetComponent(); 56 | 57 | dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName; 58 | 59 | // Asynchronously retrieves the readable file path from the StreamingAssets directory. 60 | if (fpsMonitor != null) 61 | fpsMonitor.consoleText = "Preparing file access..."; 62 | 63 | dlibShapePredictorFilePath = await Utils.getFilePathAsyncTask(dlibShapePredictorFileName, cancellationToken: cts.Token); 64 | 65 | if (fpsMonitor != null) 66 | fpsMonitor.consoleText = ""; 67 | 68 | Run(); 69 | } 70 | 71 | private void Run() 72 | { 73 | if (string.IsNullOrEmpty(dlibShapePredictorFilePath)) 74 | { 75 | Debug.LogError("shape predictor file does not exist. Please copy from “DlibFaceLandmarkDetector/StreamingAssets/DlibFaceLandmarkDetector/” to “Assets/StreamingAssets/DlibFaceLandmarkDetector/” folder. "); 76 | } 77 | 78 | //if true, The error log of the Native side Dlib will be displayed on the Unity Editor Console. 79 | Utils.setDebugMode(true); 80 | 81 | Texture2D dstTexture2D = new Texture2D(texture2D.width, texture2D.height, texture2D.format, false); 82 | dstTexture2D.SetPixels32(texture2D.GetPixels32()); 83 | dstTexture2D.Apply(); 84 | 85 | FaceLandmarkDetector faceLandmarkDetector = new FaceLandmarkDetector(dlibShapePredictorFilePath); 86 | faceLandmarkDetector.SetImage(texture2D); 87 | 88 | //detect face rects 89 | List detectResult = faceLandmarkDetector.Detect(); 90 | 91 | 92 | foreach (var rect in detectResult) 93 | { 94 | Debug.Log("face : " + rect); 95 | 96 | //detect landmark points 97 | List points = faceLandmarkDetector.DetectLandmark(rect); 98 | 99 | Debug.Log("face points count : " + points.Count); 100 | foreach (var point in points) 101 | { 102 | Debug.Log("face point : x " + point.x + " y " + point.y); 103 | } 104 | 105 | //draw landmark points 106 | faceLandmarkDetector.DrawDetectLandmarkResult(dstTexture2D, 0, 255, 0, 255); 107 | 108 | } 109 | 110 | if (faceLandmarkDetector.GetShapePredictorNumParts() != 68) 111 | Debug.LogWarning("The DrawDetectLandmarkResult method does not support ShapePredictorNumParts sizes other than 68 points, so the drawing will be incorrect." 112 | + " If you want to draw the result correctly, we recommend using the OpenCVForUnityUtils.DrawFaceLandmark method."); 113 | 114 | //draw face rect 115 | faceLandmarkDetector.DrawDetectResult(dstTexture2D, 255, 0, 0, 255, 2); 116 | 117 | faceLandmarkDetector.Dispose(); 118 | 119 | resultPreview.texture = dstTexture2D; 120 | resultPreview.GetComponent().aspectRatio = (float)dstTexture2D.width / dstTexture2D.height; 121 | 122 | 123 | Utils.setDebugMode(false); 124 | 125 | if (fpsMonitor != null) 126 | { 127 | fpsMonitor.Add("dlib shape predictor", dlibShapePredictorFileName); 128 | fpsMonitor.Add("width", dstTexture2D.width.ToString()); 129 | fpsMonitor.Add("height", dstTexture2D.height.ToString()); 130 | fpsMonitor.Add("orientation", Screen.orientation.ToString()); 131 | } 132 | } 133 | 134 | // Update is called once per frame 135 | void Update() 136 | { 137 | 138 | } 139 | 140 | /// 141 | /// Raises the disable event. 142 | /// 143 | void OnDisable() 144 | { 145 | if (cts != null) 146 | cts.Dispose(); 147 | } 148 | 149 | /// 150 | /// Raises the back button click event. 151 | /// 152 | public void OnBackButtonClick() 153 | { 154 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Texture2DExample/Texture2DExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4d3f767ecb624f4bbc2e5a49c48fd0b 3 | timeCreated: 1461437970 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Texture2DExample/Texture2DExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 395c78d8a8e9cc54282ffbc365e28683 3 | timeCreated: 1461437970 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fea2866ce285cc4a816dee875af3c3f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/FpsMonitor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2a2cf2e440488b469909734cef79c8c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/FpsMonitor/FpsMonitor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace DlibFaceLandmarkDetectorExample 6 | { 7 | // v1.0.3 8 | public class FpsMonitor : MonoBehaviour 9 | { 10 | int tick = 0; 11 | float elapsed = 0; 12 | float fps = 0; 13 | 14 | public enum Alignment 15 | { 16 | LeftTop, 17 | RightTop, 18 | LeftBottom, 19 | RightBottom, 20 | } 21 | 22 | public Alignment alignment = Alignment.RightTop; 23 | 24 | const float GUI_WIDTH = 95f; 25 | const float GUI_HEIGHT = 35f; 26 | const float MARGIN_X = 10f; 27 | const float MARGIN_Y = 10f; 28 | const float INNER_X = 10f; 29 | const float INNER_Y = 10f; 30 | const float GUI_CONSOLE_HEIGHT = 100f; 31 | 32 | public Vector2 offset = new Vector2(MARGIN_X, MARGIN_Y); 33 | public bool boxVisible = true; 34 | public float boxWidth = GUI_WIDTH; 35 | public float boxHeight = GUI_HEIGHT; 36 | public Vector2 padding = new Vector2(INNER_X, INNER_Y); 37 | public float consoleHeight = GUI_CONSOLE_HEIGHT; 38 | 39 | private Text fpsTextComponent; 40 | private Text consoleTextComponent; 41 | private GameObject fpsPanel; 42 | private GameObject consolePanel; 43 | private Canvas canvas; 44 | 45 | Dictionary outputDict = new Dictionary(); 46 | 47 | protected string _consoleText = null; 48 | public virtual string consoleText 49 | { 50 | get { return _consoleText; } 51 | set 52 | { 53 | _consoleText = value; 54 | toast_time = -1; 55 | UpdateConsoleText(); 56 | } 57 | } 58 | 59 | float toast_time = -1; // Managed in milliseconds 60 | 61 | // Additional: Reference to the background Image GameObject 62 | private GameObject fpsBackgroundObj; 63 | private GameObject consoleBackgroundObj; 64 | 65 | private bool _needsUpdate = false; 66 | private bool _isInitialized = false; 67 | 68 | // Path to the prefab 69 | private const string CANVAS_PREFAB_PATH = "FpsMonitorCanvas_103"; 70 | 71 | // Lifecycle methods 72 | void Awake() 73 | { 74 | LoadCanvasFromPrefab(); 75 | LocateUI(); 76 | _isInitialized = true; 77 | _needsUpdate = true; 78 | } 79 | 80 | void LoadCanvasFromPrefab() 81 | { 82 | // Load Canvas from Prefab 83 | GameObject prefab = Resources.Load(CANVAS_PREFAB_PATH); 84 | if (prefab == null) 85 | { 86 | Debug.LogError($"Failed to load FpsMonitorCanvas prefab from {CANVAS_PREFAB_PATH}"); 87 | return; 88 | } 89 | 90 | // Instantiate Canvas 91 | GameObject canvasObj = Instantiate(prefab); 92 | // Set the name to the part before the first underscore (if any) 93 | int underscoreIndex = prefab.name.IndexOf('_'); 94 | if (underscoreIndex > 0) 95 | canvasObj.name = prefab.name.Substring(0, underscoreIndex); 96 | else 97 | canvasObj.name = prefab.name; 98 | canvas = canvasObj.GetComponent(); 99 | if (canvas == null) 100 | { 101 | Debug.LogError("FpsMonitorCanvas prefab does not have a Canvas component"); 102 | return; 103 | } 104 | 105 | // Get references to required components 106 | fpsPanel = canvasObj.transform.Find("FpsPanel")?.gameObject; 107 | consolePanel = canvasObj.transform.Find("ConsolePanel")?.gameObject; 108 | 109 | if (fpsPanel != null) 110 | { 111 | fpsTextComponent = fpsPanel.transform.Find("Mask/FpsText")?.GetComponent(); 112 | fpsBackgroundObj = fpsPanel.transform.Find("Mask/Background")?.gameObject; 113 | } 114 | 115 | if (consolePanel != null) 116 | { 117 | consoleTextComponent = consolePanel.transform.Find("Mask/ConsoleText")?.GetComponent(); 118 | consoleBackgroundObj = consolePanel.transform.Find("Mask/Background")?.gameObject; 119 | } 120 | 121 | // Initial display settings 122 | if (fpsPanel != null) fpsPanel.SetActive(true); 123 | if (consolePanel != null) consolePanel.SetActive(false); 124 | 125 | // Show/hide background 126 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 127 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 128 | } 129 | 130 | void OnDestroy() 131 | { 132 | if (canvas != null) 133 | { 134 | Destroy(canvas.gameObject); 135 | } 136 | } 137 | 138 | // Update method 139 | void Update() 140 | { 141 | tick++; 142 | elapsed += Time.deltaTime; 143 | if (elapsed >= 1f) 144 | { 145 | fps = tick / elapsed; 146 | tick = 0; 147 | elapsed = 0; 148 | UpdateFpsText(); 149 | } 150 | 151 | if (toast_time > 0) 152 | { 153 | toast_time -= Time.deltaTime * 1000; // Decrement in milliseconds 154 | if (toast_time <= 0) 155 | { 156 | _consoleText = ""; 157 | UpdateConsoleText(); 158 | } 159 | } 160 | 161 | if (_needsUpdate) 162 | { 163 | _needsUpdate = false; 164 | UpdateUI(); 165 | } 166 | } 167 | 168 | void OnValidate() 169 | { 170 | if (Application.isPlaying) 171 | { 172 | _needsUpdate = true; 173 | } 174 | } 175 | 176 | // UI-related methods 177 | void LocateUI() 178 | { 179 | if (fpsPanel == null || consolePanel == null) return; 180 | 181 | // Set FPS panel position 182 | var fpsRect = fpsPanel.GetComponent(); 183 | switch (alignment) 184 | { 185 | case Alignment.LeftTop: 186 | fpsRect.anchorMin = new Vector2(0, 1); 187 | fpsRect.anchorMax = new Vector2(0, 1); 188 | fpsRect.pivot = new Vector2(0, 1); 189 | fpsRect.anchoredPosition = new Vector2(offset.x, -offset.y); 190 | break; 191 | case Alignment.RightTop: 192 | fpsRect.anchorMin = new Vector2(1, 1); 193 | fpsRect.anchorMax = new Vector2(1, 1); 194 | fpsRect.pivot = new Vector2(1, 1); 195 | fpsRect.anchoredPosition = new Vector2(-offset.x, -offset.y); 196 | break; 197 | case Alignment.LeftBottom: 198 | fpsRect.anchorMin = new Vector2(0, 0); 199 | fpsRect.anchorMax = new Vector2(0, 0); 200 | fpsRect.pivot = new Vector2(0, 0); 201 | fpsRect.anchoredPosition = new Vector2(offset.x, offset.y); 202 | break; 203 | case Alignment.RightBottom: 204 | fpsRect.anchorMin = new Vector2(1, 0); 205 | fpsRect.anchorMax = new Vector2(1, 0); 206 | fpsRect.pivot = new Vector2(1, 0); 207 | fpsRect.anchoredPosition = new Vector2(-offset.x, offset.y); 208 | break; 209 | } 210 | 211 | // Set console panel position 212 | var consoleRect = consolePanel.GetComponent(); 213 | consoleRect.anchorMin = new Vector2(0, 0); 214 | consoleRect.anchorMax = new Vector2(1, 0); 215 | consoleRect.pivot = new Vector2(0.5f, 0); 216 | consoleRect.offsetMin = new Vector2(offset.x, offset.y); 217 | consoleRect.offsetMax = new Vector2(-offset.x, offset.y + consoleHeight); 218 | 219 | // Show/hide background 220 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 221 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 222 | } 223 | 224 | void UpdateUI() 225 | { 226 | if (fpsPanel != null) 227 | { 228 | var rectTransform = fpsPanel.GetComponent(); 229 | rectTransform.sizeDelta = new Vector2(boxWidth, boxHeight); 230 | 231 | // Update FPS text padding 232 | var fpsTextTransform = fpsTextComponent?.GetComponent(); 233 | if (fpsTextTransform != null) 234 | { 235 | fpsTextTransform.offsetMin = new Vector2(padding.x, padding.y); 236 | fpsTextTransform.offsetMax = new Vector2(-padding.x, -padding.y); 237 | } 238 | } 239 | 240 | if (consolePanel != null) 241 | { 242 | var rectTransform = consolePanel.GetComponent(); 243 | rectTransform.sizeDelta = new Vector2(Screen.width - offset.x * 2, consoleHeight); 244 | 245 | // Update console text padding 246 | var consoleTextTransform = consoleTextComponent?.GetComponent(); 247 | if (consoleTextTransform != null) 248 | { 249 | consoleTextTransform.offsetMin = new Vector2(padding.x, padding.y); 250 | consoleTextTransform.offsetMax = new Vector2(-padding.x, -padding.y); 251 | } 252 | } 253 | 254 | // Update show/hide background 255 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 256 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 257 | 258 | // Update panel position 259 | LocateUI(); 260 | } 261 | 262 | // Text update methods 263 | void UpdateFpsText() 264 | { 265 | if (fpsTextComponent == null) return; 266 | 267 | // Display FPS value directly 268 | string text = $"fps : {fps:F1}"; 269 | 270 | // Add only if there is additional information 271 | if (outputDict.Count > 0) 272 | { 273 | foreach (KeyValuePair pair in outputDict) 274 | { 275 | text += $"\n{pair.Key} : {pair.Value}"; 276 | } 277 | } 278 | 279 | fpsTextComponent.text = text; 280 | fpsTextComponent.enabled = true; 281 | fpsTextComponent.gameObject.SetActive(true); 282 | } 283 | 284 | void UpdateConsoleText() 285 | { 286 | if (consoleTextComponent == null || consolePanel == null) 287 | { 288 | Debug.LogWarning("UpdateConsoleText: consoleTextComponent or consolePanel is null"); 289 | return; 290 | } 291 | 292 | if (!string.IsNullOrEmpty(_consoleText) && toast_time != 0) 293 | { 294 | consoleTextComponent.text = _consoleText; 295 | consolePanel.SetActive(true); 296 | consoleTextComponent.gameObject.SetActive(true); 297 | } 298 | else 299 | { 300 | consoleTextComponent.text = ""; 301 | consolePanel.SetActive(false); 302 | consoleTextComponent.gameObject.SetActive(false); 303 | } 304 | } 305 | 306 | // Public methods 307 | public void Add(string key, string value) 308 | { 309 | if (outputDict.ContainsKey(key)) 310 | { 311 | outputDict[key] = value; 312 | } 313 | else 314 | { 315 | outputDict.Add(key, value); 316 | } 317 | UpdateFpsText(); 318 | } 319 | 320 | public void Remove(string key) 321 | { 322 | outputDict.Remove(key); 323 | UpdateFpsText(); 324 | } 325 | 326 | public void Clear() 327 | { 328 | outputDict.Clear(); 329 | UpdateFpsText(); 330 | } 331 | 332 | public void LocateGUI() 333 | { 334 | _needsUpdate = true; 335 | } 336 | 337 | public void Toast(string message, float timeMs = 2000f) // Default is 2 seconds 338 | { 339 | _consoleText = message; 340 | toast_time = Mathf.Max(timeMs, 1000f); // Minimum 1 second 341 | 342 | if (!_isInitialized) 343 | { 344 | Debug.LogError("Toast: FpsMonitor is not initialized. Make sure FpsMonitor is properly set up in the scene."); 345 | return; 346 | } 347 | 348 | UpdateConsoleText(); 349 | } 350 | } 351 | } 352 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/FpsMonitor/FpsMonitor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b5f6e0cfc1aae24d8f029d13c507070 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/FpsMonitor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73d0824e7488796488a5809eaeaf16f2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/FpsMonitor/Resources/FpsMonitorCanvas_103.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d1126f8a58f264479a82d90d811f106 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/InputModuleSwitcher.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | #if ENABLE_INPUT_SYSTEM 4 | using UnityEngine.InputSystem.UI; 5 | #endif 6 | 7 | namespace DlibFaceLandmarkDetectorExample 8 | { 9 | /// 10 | /// Input Module Switcher that automatically configures the appropriate Input Module based on the input system being used. 11 | /// 12 | [RequireComponent(typeof(EventSystem))] 13 | public class InputModuleSwitcher : MonoBehaviour 14 | { 15 | private void Awake() 16 | { 17 | SetupInputSystem(); 18 | } 19 | 20 | private void SetupInputSystem() 21 | { 22 | var eventSystem = GetComponent(); 23 | if (eventSystem == null) 24 | return; 25 | 26 | #if ENABLE_INPUT_SYSTEM 27 | // Remove old Input Module if it exists 28 | var oldInput = eventSystem.GetComponent(); 29 | if (oldInput != null) 30 | { 31 | Destroy(oldInput); 32 | } 33 | 34 | // Add new Input Module if it doesn't exist 35 | if (eventSystem.GetComponent() == null) 36 | { 37 | eventSystem.gameObject.AddComponent(); 38 | } 39 | #endif 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/InputModuleSwitcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f4eb91c89679704f9dd6de8bcbeea0b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/TouchController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | #if ENABLE_INPUT_SYSTEM 4 | using UnityEngine.InputSystem; 5 | using UnityEngine.InputSystem.EnhancedTouch; 6 | #endif 7 | 8 | namespace DlibFaceLandmarkDetectorExample 9 | { 10 | public class TouchController : MonoBehaviour 11 | { 12 | public GameObject Cube; 13 | public float Speed = 0.1f; 14 | 15 | #if ENABLE_INPUT_SYSTEM 16 | private void OnEnable() 17 | { 18 | EnhancedTouchSupport.Enable(); 19 | } 20 | 21 | private void OnDisable() 22 | { 23 | EnhancedTouchSupport.Disable(); 24 | } 25 | #endif 26 | 27 | void Update() 28 | { 29 | #if ENABLE_INPUT_SYSTEM 30 | // New Input System 31 | #if ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR) 32 | // Touch input for mobile platforms 33 | if (UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count == 1) 34 | { 35 | var touch = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches[0]; 36 | 37 | // Ignore touch on UI elements 38 | if (EventSystem.current != null && EventSystem.current.IsPointerOverGameObject(touch.finger.index)) 39 | return; 40 | 41 | switch (touch.phase) 42 | { 43 | case UnityEngine.InputSystem.TouchPhase.Moved: 44 | float xAngle = touch.delta.y * Speed; 45 | float yAngle = -touch.delta.x * Speed; 46 | float zAngle = 0f; 47 | 48 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 49 | break; 50 | } 51 | } 52 | #else 53 | // Mouse input for non-mobile platforms 54 | var mouse = Mouse.current; 55 | if (mouse != null && mouse.leftButton.isPressed) 56 | { 57 | if (EventSystem.current.IsPointerOverGameObject()) 58 | return; 59 | 60 | var delta = mouse.delta.ReadValue(); 61 | float xAngle = delta.y * Speed; 62 | float yAngle = -delta.x * Speed; 63 | float zAngle = 0; 64 | 65 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 66 | } 67 | #endif 68 | #else 69 | // Old Input System 70 | #if ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR) 71 | // Touch input for mobile platforms 72 | int touchCount = Input.touchCount; 73 | 74 | if (touchCount == 1) 75 | { 76 | Touch t = Input.GetTouch(0); 77 | if (EventSystem.current.IsPointerOverGameObject(t.fingerId)) 78 | return; 79 | 80 | switch (t.phase) 81 | { 82 | case TouchPhase.Moved: 83 | float xAngle = t.deltaPosition.y * Speed; 84 | float yAngle = -t.deltaPosition.x * Speed; 85 | float zAngle = 0; 86 | 87 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 88 | break; 89 | } 90 | } 91 | #else 92 | // Mouse input for non-mobile platforms 93 | if (Input.GetMouseButton(0)) 94 | { 95 | if (EventSystem.current.IsPointerOverGameObject()) 96 | return; 97 | 98 | float xAngle = Input.GetAxis("Mouse Y") * Speed * 80; 99 | float yAngle = -Input.GetAxis("Mouse X") * Speed * 80; 100 | float zAngle = 0; 101 | 102 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 103 | } 104 | #endif 105 | #endif 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/Utils/TouchController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3758ca8fdfa0423408edf44b22cc0777 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/WebCamTextureExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1d86e9724cff554a9cbf6566c3729a1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/WebCamTextureExample/WebCamTextureExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e15358a2c07735e4a961c98ec541c903 3 | timeCreated: 1461438336 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/WebCamTextureExample/WebCamTextureExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d10e63dad123dea49ab251a205ecf64f 3 | timeCreated: 1461438336 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Examples/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a06900ff120560f43a526992e1895d27 3 | timeCreated: 1572018988 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Notices.txt: -------------------------------------------------------------------------------- 1 | Dlib FaceLandmark Detector is governed by the Asset Store EULA; however, the following components are governed by the licenses indicated below: 2 | 3 | - Dlib : Boost Software License 4 | 5 | Boost Software License - Version 1.0 - August 17th, 2003 6 | 7 | Permission is hereby granted, free of charge, to any person or organization 8 | obtaining a copy of the software and accompanying documentation covered by 9 | this license (the "Software") to use, reproduce, display, distribute, 10 | execute, and transmit the Software, and to prepare derivative works of the 11 | Software, and to permit third-parties to whom the Software is furnished to 12 | do so, all subject to the following: 13 | 14 | The copyright notices in the Software and this entire statement, including 15 | the above license grant, this restriction and the following disclaimer, 16 | must be included in all copies of the Software, in whole or in part, and 17 | all derivative works of the Software, unless such copies or derivative 18 | works are solely in the form of machine-executable object code generated by 19 | a source language processor. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 24 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 25 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/Notices.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 548b84fdd18578f448adad6472d6e53e 3 | timeCreated: 1531911535 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/ReadMe.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetector/ReadMe.pdf -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetector/ReadMe.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e64c0e4458a9a4853ad7748deb2d6b01 3 | timeCreated: 1463757341 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ab6e5ffe0aa2d242a6c897b5d6e2f4d 3 | folderAsset: yes 4 | timeCreated: 1461849369 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08e96c3cc05e69d409fbb0838cdbe6c8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61d7d0a61650d5c4aa72fb82656b69a5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f3dce81810c2af4b913556f4c8e3480 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71076ebc11832254983567bc2f8df2c8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_glitter_2.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: eff_glitter_2 10 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b0ffb540d124f4144ad76e36fe41b91d, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_glitter_2.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab6d36e9c16ce4fbea9b063c3ee8e129 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_par_1.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: eff_par_1 10 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: f8b1a36af41214f079689857ae15f1ea, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_par_1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1eb614596030841cbbdb034483a7b79c 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_smoke_2.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: eff_smoke_2 11 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _MainTex: 23 | m_Texture: {fileID: 2800000, guid: 3c006f387d1b24898aa7ed5056023bb3, type: 3} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | m_Floats: 27 | - _InvFade: 1 28 | m_Colors: 29 | - _Color: {r: 1, g: 1, b: 1, a: 1} 30 | - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 31 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Materials/eff_smoke_2.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c336fee2e55784686950c68ddf95fc3a 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da4b5750919eed04dadc37699e00f9c8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Prefab/Eff_Laser_2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 228126a19741c418db496a12b007010e 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2572cec8aa64ed4cb708739798d498c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_Glitter2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_Glitter2.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_Glitter2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0ffb540d124f4144ad76e36fe41b91d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: 5 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_smoke_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_smoke_1.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/Eff_smoke_1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c006f387d1b24898aa7ed5056023bb3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: 5 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/eff_par_1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/eff_par_1.tga -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/EyeLaser/Textures/eff_par_1.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8b1a36af41214f079689857ae15f1ea 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: 0 28 | aniso: 0 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: 5 43 | buildTargetSettings: 44 | - buildTarget: iPhone 45 | maxTextureSize: 1024 46 | textureFormat: 32 47 | compressionQuality: 50 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c18932f9c48c52247967eaa03d0c9b0b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_x_material_Built-in.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: axes_x_material_Built-in 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHABLEND_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 2 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 5 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 1, g: 0, b: 0, a: 0.78431374} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | m_BuildTextureStacks: [] 80 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_x_material_Built-in.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3e41aee144989a4896c52810fd13245 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_x_material_SRP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: axes_x_material_SRP 11 | m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} 12 | m_ValidKeywords: 13 | - _EMISSION 14 | - _SURFACE_TYPE_TRANSPARENT 15 | m_InvalidKeywords: [] 16 | m_LightmapFlags: 0 17 | m_EnableInstancingVariants: 0 18 | m_DoubleSidedGI: 0 19 | m_CustomRenderQueue: 3000 20 | stringTagMap: 21 | RenderType: Transparent 22 | disabledShaderPasses: 23 | - DepthOnly 24 | - SHADOWCASTER 25 | m_SavedProperties: 26 | serializedVersion: 3 27 | m_TexEnvs: 28 | - _AlphaTex: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | - _BaseMap: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - _BumpMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _DetailAlbedoMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _DetailMask: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _DetailNormalMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _EmissionMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _MainTex: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _MetallicGlossMap: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - _OcclusionMap: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - _ParallaxMap: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - _SpecGlossMap: 73 | m_Texture: {fileID: 0} 74 | m_Scale: {x: 1, y: 1} 75 | m_Offset: {x: 0, y: 0} 76 | - unity_Lightmaps: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | - unity_LightmapsInd: 81 | m_Texture: {fileID: 0} 82 | m_Scale: {x: 1, y: 1} 83 | m_Offset: {x: 0, y: 0} 84 | - unity_ShadowMasks: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | m_Ints: [] 89 | m_Floats: 90 | - PixelSnap: 0 91 | - _AlphaClip: 0 92 | - _Blend: 0 93 | - _BlendOp: 0 94 | - _BumpScale: 1 95 | - _CameraFadingEnabled: 0 96 | - _CameraFarFadeDistance: 2 97 | - _CameraNearFadeDistance: 1 98 | - _ClearCoatMask: 0 99 | - _ClearCoatSmoothness: 0 100 | - _ColorMask: 15 101 | - _ColorMode: 0 102 | - _Cull: 2 103 | - _Cutoff: 0.5 104 | - _DetailAlbedoMapScale: 1 105 | - _DetailNormalMapScale: 1 106 | - _DistortionBlend: 0.5 107 | - _DistortionEnabled: 0 108 | - _DistortionStrength: 1 109 | - _DistortionStrengthScaled: 0 110 | - _DstBlend: 10 111 | - _EmissionEnabled: 0 112 | - _EnableExternalAlpha: 0 113 | - _EnvironmentReflections: 1 114 | - _FlipbookMode: 0 115 | - _GlossMapScale: 0 116 | - _Glossiness: 0 117 | - _GlossinessSource: 0 118 | - _GlossyReflections: 0 119 | - _LightingEnabled: 0 120 | - _Metallic: 0 121 | - _Mode: 0 122 | - _OcclusionStrength: 1 123 | - _Parallax: 0.005 124 | - _QueueOffset: 0 125 | - _ReceiveShadows: 1 126 | - _SampleGI: 0 127 | - _Shininess: 0 128 | - _Smoothness: 0.5 129 | - _SmoothnessSource: 0 130 | - _SmoothnessTextureChannel: 0 131 | - _SoftParticlesEnabled: 0 132 | - _SoftParticlesFarFadeDistance: 1 133 | - _SoftParticlesNearFadeDistance: 0 134 | - _SpecSource: 0 135 | - _SpecularHighlights: 1 136 | - _SrcBlend: 5 137 | - _Stencil: 0 138 | - _StencilComp: 8 139 | - _StencilOp: 0 140 | - _StencilReadMask: 255 141 | - _StencilWriteMask: 255 142 | - _Surface: 1 143 | - _UVSec: 0 144 | - _UseUIAlphaClip: 0 145 | - _WorkflowMode: 1 146 | - _ZWrite: 0 147 | m_Colors: 148 | - _BaseColor: {r: 1, g: 0, b: 0, a: 0.78431374} 149 | - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} 150 | - _Color: {r: 1, g: 0, b: 0, a: 0.78431374} 151 | - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} 152 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 153 | - _Flip: {r: 1, g: 1, b: 1, a: 1} 154 | - _RendererColor: {r: 1, g: 1, b: 1, a: 1} 155 | - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} 156 | - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 157 | - _Specular: {r: 0, g: 0, b: 0, a: 0} 158 | m_BuildTextureStacks: [] 159 | --- !u!114 &8187207135265761674 160 | MonoBehaviour: 161 | m_ObjectHideFlags: 11 162 | m_CorrespondingSourceObject: {fileID: 0} 163 | m_PrefabInstance: {fileID: 0} 164 | m_PrefabAsset: {fileID: 0} 165 | m_GameObject: {fileID: 0} 166 | m_Enabled: 1 167 | m_EditorHideFlags: 0 168 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 169 | m_Name: 170 | m_EditorClassIdentifier: 171 | version: 5 172 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_x_material_SRP.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a5bd3686ce0ab84189c74f5ee3542b9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_y_material_Built-in.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: axes_y_material_Built-in 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHABLEND_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 2 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 5 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 0, g: 1, b: 0, a: 0.78431374} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | m_BuildTextureStacks: [] 80 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_y_material_Built-in.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5859154fc41a56348967a480ce7b9305 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_y_material_SRP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: axes_y_material_SRP 11 | m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} 12 | m_ValidKeywords: 13 | - _SURFACE_TYPE_TRANSPARENT 14 | m_InvalidKeywords: [] 15 | m_LightmapFlags: 4 16 | m_EnableInstancingVariants: 0 17 | m_DoubleSidedGI: 0 18 | m_CustomRenderQueue: 3000 19 | stringTagMap: 20 | RenderType: Transparent 21 | disabledShaderPasses: 22 | - DepthOnly 23 | - SHADOWCASTER 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _EmissionMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _MainTex: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _SpecGlossMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - unity_Lightmaps: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - unity_LightmapsInd: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - unity_ShadowMasks: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Ints: [] 60 | m_Floats: 61 | - _AlphaClip: 0 62 | - _Blend: 0 63 | - _BumpScale: 1 64 | - _Cull: 2 65 | - _Cutoff: 0.5 66 | - _DstBlend: 10 67 | - _GlossinessSource: 0 68 | - _QueueOffset: 0 69 | - _ReceiveShadows: 1 70 | - _Shininess: 0 71 | - _Smoothness: 0.5 72 | - _SmoothnessSource: 0 73 | - _SpecSource: 0 74 | - _SpecularHighlights: 1 75 | - _SrcBlend: 5 76 | - _Surface: 1 77 | - _ZWrite: 0 78 | m_Colors: 79 | - _BaseColor: {r: 0, g: 1, b: 0, a: 0.78431374} 80 | - _Color: {r: 0, g: 1, b: 0, a: 0.78431374} 81 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 82 | - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 83 | m_BuildTextureStacks: [] 84 | --- !u!114 &8980568532161993466 85 | MonoBehaviour: 86 | m_ObjectHideFlags: 11 87 | m_CorrespondingSourceObject: {fileID: 0} 88 | m_PrefabInstance: {fileID: 0} 89 | m_PrefabAsset: {fileID: 0} 90 | m_GameObject: {fileID: 0} 91 | m_Enabled: 1 92 | m_EditorHideFlags: 0 93 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 94 | m_Name: 95 | m_EditorClassIdentifier: 96 | version: 5 97 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_y_material_SRP.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d63b0d8adef88f428b1b90d9e017ee1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_z_material_Built-in.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: axes_z_material_Built-in 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHABLEND_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 2 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 5 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 0, g: 0, b: 1, a: 0.78431374} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | m_BuildTextureStacks: [] 80 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_z_material_Built-in.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1ace0348fb13ef4c9c749b3ba6e53c5 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_z_material_SRP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-2310360049896207115 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 5 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 8 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: axes_z_material_SRP 24 | m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} 25 | m_ValidKeywords: 26 | - _SURFACE_TYPE_TRANSPARENT 27 | m_InvalidKeywords: [] 28 | m_LightmapFlags: 4 29 | m_EnableInstancingVariants: 0 30 | m_DoubleSidedGI: 0 31 | m_CustomRenderQueue: 3000 32 | stringTagMap: 33 | RenderType: Transparent 34 | disabledShaderPasses: 35 | - DepthOnly 36 | - SHADOWCASTER 37 | m_SavedProperties: 38 | serializedVersion: 3 39 | m_TexEnvs: 40 | - _BaseMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _BumpMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _EmissionMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _MainTex: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _SpecGlossMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - unity_Lightmaps: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - unity_LightmapsInd: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - unity_ShadowMasks: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Ints: [] 73 | m_Floats: 74 | - _AlphaClip: 0 75 | - _Blend: 0 76 | - _BumpScale: 1 77 | - _Cull: 2 78 | - _Cutoff: 0.5 79 | - _DstBlend: 10 80 | - _GlossinessSource: 0 81 | - _QueueOffset: 0 82 | - _ReceiveShadows: 1 83 | - _Shininess: 0 84 | - _Smoothness: 0.5 85 | - _SmoothnessSource: 0 86 | - _SpecSource: 0 87 | - _SpecularHighlights: 1 88 | - _SrcBlend: 5 89 | - _Surface: 1 90 | - _ZWrite: 0 91 | m_Colors: 92 | - _BaseColor: {r: 0, g: 0, b: 1, a: 0.78431374} 93 | - _Color: {r: 0, g: 0, b: 1, a: 0.78431374} 94 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 95 | - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 96 | m_BuildTextureStacks: [] 97 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/axes_z_material_SRP.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 433d1db0f10890e41a3b7248f792df80 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/head_material_Built-in.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: head_material_Built-in 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHABLEND_ON _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 2 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 5 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 1, g: 0, b: 0, a: 0.49803922} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | m_BuildTextureStacks: [] 80 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/head_material_Built-in.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cedcb7237bb495b42aecf2987af5c8cf 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/head_material_SRP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-1922099716254973376 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 5 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 8 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: head_material_SRP 24 | m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} 25 | m_ValidKeywords: 26 | - _EMISSION 27 | - _SURFACE_TYPE_TRANSPARENT 28 | m_InvalidKeywords: [] 29 | m_LightmapFlags: 1 30 | m_EnableInstancingVariants: 0 31 | m_DoubleSidedGI: 0 32 | m_CustomRenderQueue: 3000 33 | stringTagMap: 34 | RenderType: Transparent 35 | disabledShaderPasses: 36 | - DepthOnly 37 | - SHADOWCASTER 38 | m_SavedProperties: 39 | serializedVersion: 3 40 | m_TexEnvs: 41 | - _BaseMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _BumpMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _EmissionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _MainTex: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _SpecGlossMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - unity_Lightmaps: 62 | m_Texture: {fileID: 0} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | - unity_LightmapsInd: 66 | m_Texture: {fileID: 0} 67 | m_Scale: {x: 1, y: 1} 68 | m_Offset: {x: 0, y: 0} 69 | - unity_ShadowMasks: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | m_Ints: [] 74 | m_Floats: 75 | - _AlphaClip: 0 76 | - _Blend: 0 77 | - _BumpScale: 1 78 | - _Cull: 2 79 | - _Cutoff: 0.5 80 | - _DstBlend: 10 81 | - _GlossinessSource: 0 82 | - _QueueOffset: 0 83 | - _ReceiveShadows: 1 84 | - _Shininess: 0 85 | - _Smoothness: 0.5 86 | - _SmoothnessSource: 0 87 | - _SpecSource: 0 88 | - _SpecularHighlights: 1 89 | - _SrcBlend: 5 90 | - _Surface: 1 91 | - _ZWrite: 0 92 | m_Colors: 93 | - _BaseColor: {r: 1, g: 0, b: 0, a: 0.49803922} 94 | - _Color: {r: 1, g: 0, b: 0, a: 0.49803922} 95 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 96 | - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 97 | m_BuildTextureStacks: [] 98 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/head_material_SRP.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed721ba6d8b9c1249a77ae274187e59d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/quad_material.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: quad_material 10 | m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Materials/quad_material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fe89ad658086d24f8fe283057df260d 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83c84711fd83e044c9f725542b5d6677 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49d137fc7ef34db4b80b4e5b4222f7ba 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Materials/eff_heart_1.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: eff_heart_1 10 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 99f812eaed1274ca6a538812c7494cf8, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Materials/eff_heart_1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94c5b29c4f55c45dfb6783a31910b000 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e728615f0ca665842992b9674bde9aa5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Prefab/Eff_Laser_5.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b040df1730c2a44bf901b8f770ecebda 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c9923cbd292db346b8f4ad945baeb47 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Textures/Eff_Heart_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Textures/Eff_Heart_1.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/MouthLaser/Textures/Eff_Heart_1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99f812eaed1274ca6a538812c7494cf8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: 5 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a20e79c360c162c45a4416d4d6565d24 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_X.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 33: {fileID: 3300000} 12 | - 136: {fileID: 13600000} 13 | - 23: {fileID: 2300000} 14 | m_Layer: 5 15 | m_Name: Axes_X 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &400000 22 | Transform: 23 | m_ObjectHideFlags: 1 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | m_GameObject: {fileID: 100000} 27 | m_LocalRotation: {x: 0, y: 0, z: .707106829, w: .707106829} 28 | m_LocalPosition: {x: 25, y: 0, z: 0} 29 | m_LocalScale: {x: 10, y: 25, z: 10} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | --- !u!23 &2300000 34 | MeshRenderer: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 100000} 39 | m_Enabled: 1 40 | m_CastShadows: 1 41 | m_ReceiveShadows: 1 42 | m_Materials: 43 | - {fileID: 2100000, guid: b3e41aee144989a4896c52810fd13245, type: 2} 44 | m_SubsetIndices: 45 | m_StaticBatchRoot: {fileID: 0} 46 | m_UseLightProbes: 0 47 | m_ReflectionProbeUsage: 1 48 | m_ProbeAnchor: {fileID: 0} 49 | m_ScaleInLightmap: 1 50 | m_PreserveUVs: 0 51 | m_ImportantGI: 0 52 | m_AutoUVMaxDistance: .5 53 | m_AutoUVMaxAngle: 89 54 | m_LightmapParameters: {fileID: 0} 55 | m_SortingLayerID: 0 56 | m_SortingOrder: 0 57 | --- !u!33 &3300000 58 | MeshFilter: 59 | m_ObjectHideFlags: 1 60 | m_PrefabParentObject: {fileID: 0} 61 | m_PrefabInternal: {fileID: 100100000} 62 | m_GameObject: {fileID: 100000} 63 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 64 | --- !u!136 &13600000 65 | CapsuleCollider: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100000} 70 | m_Material: {fileID: 0} 71 | m_IsTrigger: 0 72 | m_Enabled: 1 73 | m_Radius: .5 74 | m_Height: 2 75 | m_Direction: 1 76 | m_Center: {x: 0, y: 0, z: 0} 77 | --- !u!1001 &100100000 78 | Prefab: 79 | m_ObjectHideFlags: 1 80 | serializedVersion: 2 81 | m_Modification: 82 | m_TransformParent: {fileID: 0} 83 | m_Modifications: [] 84 | m_RemovedComponents: [] 85 | m_ParentPrefab: {fileID: 0} 86 | m_RootGameObject: {fileID: 100000} 87 | m_IsPrefabParent: 1 88 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_X.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b9e77d1089cb5247aa00e2cb86a0960 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_Y.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 33: {fileID: 3300000} 12 | - 136: {fileID: 13600000} 13 | - 23: {fileID: 2300000} 14 | m_Layer: 5 15 | m_Name: Axes_Y 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &400000 22 | Transform: 23 | m_ObjectHideFlags: 1 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | m_GameObject: {fileID: 100000} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 25, z: 0} 29 | m_LocalScale: {x: 10, y: 25, z: 10} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | --- !u!23 &2300000 34 | MeshRenderer: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 100000} 39 | m_Enabled: 1 40 | m_CastShadows: 1 41 | m_ReceiveShadows: 1 42 | m_Materials: 43 | - {fileID: 2100000, guid: 5859154fc41a56348967a480ce7b9305, type: 2} 44 | m_SubsetIndices: 45 | m_StaticBatchRoot: {fileID: 0} 46 | m_UseLightProbes: 0 47 | m_ReflectionProbeUsage: 1 48 | m_ProbeAnchor: {fileID: 0} 49 | m_ScaleInLightmap: 1 50 | m_PreserveUVs: 0 51 | m_ImportantGI: 0 52 | m_AutoUVMaxDistance: .5 53 | m_AutoUVMaxAngle: 89 54 | m_LightmapParameters: {fileID: 0} 55 | m_SortingLayerID: 0 56 | m_SortingOrder: 0 57 | --- !u!33 &3300000 58 | MeshFilter: 59 | m_ObjectHideFlags: 1 60 | m_PrefabParentObject: {fileID: 0} 61 | m_PrefabInternal: {fileID: 100100000} 62 | m_GameObject: {fileID: 100000} 63 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 64 | --- !u!136 &13600000 65 | CapsuleCollider: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100000} 70 | m_Material: {fileID: 0} 71 | m_IsTrigger: 0 72 | m_Enabled: 1 73 | m_Radius: .5 74 | m_Height: 2 75 | m_Direction: 1 76 | m_Center: {x: 0, y: 0, z: 0} 77 | --- !u!1001 &100100000 78 | Prefab: 79 | m_ObjectHideFlags: 1 80 | serializedVersion: 2 81 | m_Modification: 82 | m_TransformParent: {fileID: 0} 83 | m_Modifications: [] 84 | m_RemovedComponents: [] 85 | m_ParentPrefab: {fileID: 0} 86 | m_RootGameObject: {fileID: 100000} 87 | m_IsPrefabParent: 1 88 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_Y.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8233df8b16be6b541950a0cab104a705 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_Z.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 33: {fileID: 3300000} 12 | - 136: {fileID: 13600000} 13 | - 23: {fileID: 2300000} 14 | m_Layer: 5 15 | m_Name: Axes_Z 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &400000 22 | Transform: 23 | m_ObjectHideFlags: 1 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | m_GameObject: {fileID: 100000} 27 | m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106829} 28 | m_LocalPosition: {x: 0, y: 0, z: 25} 29 | m_LocalScale: {x: 10, y: 25, z: 10} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | --- !u!23 &2300000 34 | MeshRenderer: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 100000} 39 | m_Enabled: 1 40 | m_CastShadows: 1 41 | m_ReceiveShadows: 1 42 | m_Materials: 43 | - {fileID: 2100000, guid: c1ace0348fb13ef4c9c749b3ba6e53c5, type: 2} 44 | m_SubsetIndices: 45 | m_StaticBatchRoot: {fileID: 0} 46 | m_UseLightProbes: 0 47 | m_ReflectionProbeUsage: 1 48 | m_ProbeAnchor: {fileID: 0} 49 | m_ScaleInLightmap: 1 50 | m_PreserveUVs: 0 51 | m_ImportantGI: 0 52 | m_AutoUVMaxDistance: .5 53 | m_AutoUVMaxAngle: 89 54 | m_LightmapParameters: {fileID: 0} 55 | m_SortingLayerID: 0 56 | m_SortingOrder: 0 57 | --- !u!33 &3300000 58 | MeshFilter: 59 | m_ObjectHideFlags: 1 60 | m_PrefabParentObject: {fileID: 0} 61 | m_PrefabInternal: {fileID: 100100000} 62 | m_GameObject: {fileID: 100000} 63 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 64 | --- !u!136 &13600000 65 | CapsuleCollider: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100000} 70 | m_Material: {fileID: 0} 71 | m_IsTrigger: 0 72 | m_Enabled: 1 73 | m_Radius: .5 74 | m_Height: 2 75 | m_Direction: 1 76 | m_Center: {x: 0, y: 0, z: 0} 77 | --- !u!1001 &100100000 78 | Prefab: 79 | m_ObjectHideFlags: 1 80 | serializedVersion: 2 81 | m_Modification: 82 | m_TransformParent: {fileID: 0} 83 | m_Modifications: [] 84 | m_RemovedComponents: [] 85 | m_ParentPrefab: {fileID: 0} 86 | m_RootGameObject: {fileID: 100000} 87 | m_IsPrefabParent: 1 88 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Axes_Z.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83de61287d78dcf43a5e6e1522cdc711 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3aca53ed923da4468d7846f026873be 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Materials/unnamed.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: unnamed 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _EmissionScaleUI: 0 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 0 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 1 74 | - _UVSec: 0 75 | - _ZWrite: 1 76 | m_Colors: 77 | - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} 80 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/Materials/unnamed.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 428565bbe14697c459fc21d97767ab61 3 | timeCreated: 1461779258 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/AR/Prefabs/human_male.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5e85ba0fb135ab458ef98f70225d988 3 | ModelImporter: 4 | serializedVersion: 16 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: male 11 | 7400000: Default Take 12 | 9500000: //RootNode 13 | materials: 14 | importMaterials: 1 15 | materialName: 0 16 | materialSearch: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | optimizeGameObjects: 0 21 | motionNodeName: 22 | animationCompression: 1 23 | animationRotationError: .5 24 | animationPositionError: .5 25 | animationScaleError: .5 26 | animationWrapMode: 0 27 | extraExposedTransformPaths: [] 28 | clipAnimations: [] 29 | isReadable: 1 30 | meshes: 31 | lODScreenPercentages: [] 32 | globalScale: 1 33 | meshCompression: 0 34 | addColliders: 0 35 | importBlendShapes: 1 36 | swapUVChannels: 0 37 | generateSecondaryUV: 0 38 | useFileUnits: 1 39 | optimizeMeshForGPU: 1 40 | weldVertices: 1 41 | secondaryUVAngleDistortion: 8 42 | secondaryUVAreaDistortion: 15.000001 43 | secondaryUVHardAngle: 88 44 | secondaryUVPackMargin: 4 45 | tangentSpace: 46 | normalSmoothAngle: 60 47 | splitTangentsAcrossUV: 1 48 | normalImportMode: 0 49 | tangentImportMode: 1 50 | importAnimation: 1 51 | copyAvatar: 0 52 | humanDescription: 53 | human: [] 54 | skeleton: [] 55 | armTwist: .5 56 | foreArmTwist: .5 57 | upperLegTwist: .5 58 | legTwist: .5 59 | armStretch: .0500000007 60 | legStretch: .0500000007 61 | feetSpacing: 0 62 | rootMotionBoneName: 63 | lastHumanDescriptionAvatarSource: {instanceID: 0} 64 | animationType: 2 65 | additionalBone: 0 66 | userData: 67 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/MultiSourceARHeadExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a95e140603ae33d48b8c8b0da8d483a8 3 | timeCreated: 1461597665 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/VideoCaptureARHeadExample_Built-in.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: beb96327381839a428dc3e8e73c1287a 3 | timeCreated: 1462028728 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/VideoCaptureARHeadExample_SRP.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7990138043f4c4a958cf9ffb934a3a 3 | timeCreated: 1462028728 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/WebCamTextureARHeadExample_Built-in.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9c62699539631f4bb8972ad19e16cf0 3 | timeCreated: 1461597459 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ARHeadExample/WebCamTextureARHeadExample_SRP.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84a9d982bea8ad74a8517554e7d7904e 3 | timeCreated: 1461597459 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/EnoxSoftware.DlibFaceLandmarkDetectorWithOpenCVExample.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EnoxSoftware.DlibFaceLandmarkDetectorWithOpenCVExample", 3 | "rootNamespace": "", 4 | "references": [ 5 | "EnoxSoftware.DlibFaceLandmarkDetector", 6 | "EnoxSoftware.DlibFaceLandmarkDetectorExample", 7 | "EnoxSoftware.OpenCVForUnity", 8 | "Unity.InputSystem" 9 | ], 10 | "includePlatforms": [], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": true, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": true, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/EnoxSoftware.DlibFaceLandmarkDetectorWithOpenCVExample.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3e9e142a05c0cb44a3c916c8901e518 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ExampleMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ExampleMaterial 10 | m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: a50e8a57a1143974ebf009ada6c1f3bc, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: {} 25 | m_Colors: 26 | data: 27 | first: 28 | name: _Color 29 | second: {r: 1, g: 1, b: 1, a: 1} 30 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ExampleMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92813c784741e8549b4ccb4ebb9fe7b4 3 | timeCreated: 1461957463 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/FrameOptimizationExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c11c5fa1df02a24bafc0e7c85af936f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/FrameOptimizationExample/FrameOptimizationExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b8d3fb701d2275469fc7dcc5b0a6b25 3 | timeCreated: 1469446121 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/FrameOptimizationExample/FrameOptimizationExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd931f1dedcb7464ca0bad0adbe4fa77 3 | timeCreated: 1469446121 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/LoadingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EnoxSoftware/DlibFaceLandmarkDetector/c0389436229346ed6a3dd1859fa0505d55d36e89/Assets/DlibFaceLandmarkDetectorWithOpenCVExample/LoadingIcon.png -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/LoadingIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a50e8a57a1143974ebf009ada6c1f3bc 3 | timeCreated: 1479456160 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 512 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 0 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 0 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/MultiSource2MatHelperExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e3254b7bade2f94ca38b844780bcc21 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/MultiSource2MatHelperExample/MultiSource2MatHelperExample.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector; 2 | using OpenCVForUnity.CoreModule; 3 | using OpenCVForUnity.UnityUtils.Helper; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using UnityEngine; 7 | using UnityEngine.SceneManagement; 8 | using UnityEngine.UI; 9 | 10 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 11 | { 12 | /// 13 | /// MultiSource2MatHelper Example 14 | /// 15 | [RequireComponent(typeof(MultiSource2MatHelper))] 16 | public class MultiSource2MatHelperExample : MonoBehaviour 17 | { 18 | [Header("Output")] 19 | /// 20 | /// The RawImage for previewing the result. 21 | /// 22 | public RawImage resultPreview; 23 | 24 | [Space(10)] 25 | 26 | /// 27 | /// The texture. 28 | /// 29 | Texture2D texture; 30 | 31 | /// 32 | /// The multi source to mat helper. 33 | /// 34 | MultiSource2MatHelper multiSource2MatHelper; 35 | 36 | /// 37 | /// The face landmark detector. 38 | /// 39 | FaceLandmarkDetector faceLandmarkDetector; 40 | 41 | /// 42 | /// The FPS monitor. 43 | /// 44 | FpsMonitor fpsMonitor; 45 | 46 | /// 47 | /// The dlib shape predictor file name. 48 | /// 49 | string dlibShapePredictorFileName = "DlibFaceLandmarkDetector/sp_human_face_68.dat"; 50 | 51 | /// 52 | /// The dlib shape predictor file path. 53 | /// 54 | string dlibShapePredictorFilePath; 55 | 56 | /// 57 | /// The CancellationTokenSource. 58 | /// 59 | CancellationTokenSource cts = new CancellationTokenSource(); 60 | 61 | // Use this for initialization 62 | async void Start() 63 | { 64 | fpsMonitor = GetComponent(); 65 | 66 | multiSource2MatHelper = gameObject.GetComponent(); 67 | multiSource2MatHelper.outputColorFormat = Source2MatHelperColorFormat.RGBA; 68 | 69 | dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName; 70 | 71 | // Asynchronously retrieves the readable file path from the StreamingAssets directory. 72 | if (fpsMonitor != null) 73 | fpsMonitor.consoleText = "Preparing file access..."; 74 | 75 | dlibShapePredictorFilePath = await DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsyncTask(dlibShapePredictorFileName, cancellationToken: cts.Token); 76 | 77 | if (fpsMonitor != null) 78 | fpsMonitor.consoleText = ""; 79 | 80 | Run(); 81 | } 82 | 83 | private void Run() 84 | { 85 | if (string.IsNullOrEmpty(dlibShapePredictorFilePath)) 86 | { 87 | Debug.LogError("shape predictor file does not exist. Please copy from “DlibFaceLandmarkDetector/StreamingAssets/DlibFaceLandmarkDetector/” to “Assets/StreamingAssets/DlibFaceLandmarkDetector/” folder. "); 88 | } 89 | 90 | faceLandmarkDetector = new FaceLandmarkDetector(dlibShapePredictorFilePath); 91 | 92 | multiSource2MatHelper.Initialize(); 93 | } 94 | 95 | /// 96 | /// Raises the source to mat helper initialized event. 97 | /// 98 | public void OnSourceToMatHelperInitialized() 99 | { 100 | Debug.Log("OnSourceToMatHelperInitialized"); 101 | 102 | Mat rgbaMat = multiSource2MatHelper.GetMat(); 103 | 104 | texture = new Texture2D(rgbaMat.cols(), rgbaMat.rows(), TextureFormat.RGBA32, false); 105 | OpenCVForUnity.UnityUtils.Utils.matToTexture2D(rgbaMat, texture); 106 | 107 | resultPreview.texture = texture; 108 | resultPreview.GetComponent().aspectRatio = (float)texture.width / texture.height; 109 | 110 | 111 | if (fpsMonitor != null) 112 | { 113 | fpsMonitor.Add("dlib shape predictor", dlibShapePredictorFileName); 114 | fpsMonitor.Add("width", multiSource2MatHelper.GetWidth().ToString()); 115 | fpsMonitor.Add("height", multiSource2MatHelper.GetHeight().ToString()); 116 | fpsMonitor.Add("orientation", Screen.orientation.ToString()); 117 | } 118 | } 119 | 120 | /// 121 | /// Raises the source to mat helper disposed event. 122 | /// 123 | public void OnSourceToMatHelperDisposed() 124 | { 125 | Debug.Log("OnSourceToMatHelperDisposed"); 126 | 127 | if (texture != null) 128 | { 129 | Texture2D.Destroy(texture); 130 | texture = null; 131 | } 132 | } 133 | 134 | /// 135 | /// Raises the source to mat helper error occurred event. 136 | /// 137 | /// Error code. 138 | /// Message. 139 | public void OnSourceToMatHelperErrorOccurred(Source2MatHelperErrorCode errorCode, string message) 140 | { 141 | Debug.Log("OnSourceToMatHelperErrorOccurred " + errorCode); 142 | 143 | if (fpsMonitor != null) 144 | { 145 | fpsMonitor.consoleText = "ErrorCode: " + errorCode; 146 | } 147 | } 148 | 149 | // Update is called once per frame 150 | void Update() 151 | { 152 | if (multiSource2MatHelper.IsPlaying() && multiSource2MatHelper.DidUpdateThisFrame()) 153 | { 154 | 155 | Mat rgbaMat = multiSource2MatHelper.GetMat(); 156 | 157 | OpenCVForUnityUtils.SetImage(faceLandmarkDetector, rgbaMat); 158 | 159 | //detect face rects 160 | List detectResult = faceLandmarkDetector.Detect(); 161 | 162 | foreach (var rect in detectResult) 163 | { 164 | 165 | //detect landmark points 166 | List points = faceLandmarkDetector.DetectLandmark(rect); 167 | 168 | //draw landmark points 169 | OpenCVForUnityUtils.DrawFaceLandmark(rgbaMat, points, new Scalar(0, 255, 0, 255), 2); 170 | 171 | //draw face rect 172 | OpenCVForUnityUtils.DrawFaceRect(rgbaMat, rect, new Scalar(255, 0, 0, 255), 2); 173 | } 174 | 175 | //Imgproc.putText (rgbaMat, "W:" + rgbaMat.width () + " H:" + rgbaMat.height () + " SO:" + Screen.orientation, new Point (5, rgbaMat.rows () - 10), Imgproc.FONT_HERSHEY_SIMPLEX, 0.5, new Scalar (255, 255, 255, 255), 1, Imgproc.LINE_AA, false); 176 | 177 | OpenCVForUnity.UnityUtils.Utils.matToTexture2D(rgbaMat, texture); 178 | } 179 | } 180 | 181 | /// 182 | /// Raises the destroy event. 183 | /// 184 | void OnDestroy() 185 | { 186 | if (multiSource2MatHelper != null) 187 | multiSource2MatHelper.Dispose(); 188 | 189 | if (faceLandmarkDetector != null) 190 | faceLandmarkDetector.Dispose(); 191 | 192 | if (cts != null) 193 | cts.Dispose(); 194 | } 195 | 196 | /// 197 | /// Raises the back button click event. 198 | /// 199 | public void OnBackButtonClick() 200 | { 201 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 202 | } 203 | 204 | /// 205 | /// Raises the play button click event. 206 | /// 207 | public void OnPlayButtonClick() 208 | { 209 | multiSource2MatHelper.Play(); 210 | } 211 | 212 | /// 213 | /// Raises the pause button click event. 214 | /// 215 | public void OnPauseButtonClick() 216 | { 217 | multiSource2MatHelper.Pause(); 218 | } 219 | 220 | /// 221 | /// Raises the stop button click event. 222 | /// 223 | public void OnStopButtonClick() 224 | { 225 | multiSource2MatHelper.Stop(); 226 | } 227 | 228 | /// 229 | /// Raises the change camera button click event. 230 | /// 231 | public void OnChangeCameraButtonClick() 232 | { 233 | multiSource2MatHelper.requestedIsFrontFacing = !multiSource2MatHelper.requestedIsFrontFacing; 234 | } 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/MultiSource2MatHelperExample/MultiSource2MatHelperExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 383f9da14ed1bdd4f8c696b8c4b75561 3 | timeCreated: 1497616459 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/MultiSource2MatHelperExample/VideoCapture2MatHelperExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57eda0bca2f0a4044a43bb65c5f8aa97 3 | timeCreated: 1461943641 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/MultiSource2MatHelperExample/WebCamTexture2MatHelperExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65a202271b0c5874eabd6d0db87adbfc 3 | timeCreated: 1461438370 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20e8a0fb0a51b23428e6245e5b29158e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/MultiSourceNoiseFilterExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc3fe609230c2574ca6ea37fb24697a5 3 | timeCreated: 1523228018 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f07430f6c5bce049ac624e47612781e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/KFPointsFilter.cs: -------------------------------------------------------------------------------- 1 | using OpenCVForUnity.CoreModule; 2 | using OpenCVForUnity.ImgprocModule; 3 | using OpenCVForUnity.VideoModule; 4 | using System; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 9 | { 10 | /// 11 | /// Kalman Filter Points Filter. 12 | /// v 1.0.4 13 | /// 14 | public class KFPointsFilter : PointsFilterBase 15 | { 16 | public double diffCheckSensitivity = 1; 17 | 18 | bool flag = false; 19 | double diffDlib = 1; 20 | MatOfPoint prevTrackPtsMat; 21 | 22 | List src_points; 23 | List last_points; 24 | 25 | // Kalman Filter 26 | List predict_points; 27 | int stateNum = 272; 28 | int measureNum = 136; 29 | KalmanFilter KF; 30 | Mat measurement; 31 | 32 | public KFPointsFilter(int numberOfElements) : base(numberOfElements) 33 | { 34 | diffDlib = diffDlib * (double)numberOfElements / 68.0; 35 | prevTrackPtsMat = new MatOfPoint(); 36 | 37 | src_points = new List(); 38 | for (int i = 0; i < numberOfElements; i++) 39 | { 40 | src_points.Add(new Point(0.0, 0.0)); 41 | } 42 | last_points = new List(); 43 | for (int i = 0; i < numberOfElements; i++) 44 | { 45 | last_points.Add(new Point(0.0, 0.0)); 46 | } 47 | 48 | // Initialize Kalman Filter 49 | stateNum = numberOfElements * 4; 50 | measureNum = numberOfElements * 2; 51 | InitializeKalmanFilter(); 52 | } 53 | 54 | /// 55 | /// Processes points by filter. 56 | /// 57 | /// Image mat. 58 | /// Input points. 59 | /// Output points. 60 | /// if true, draws debug points. 61 | /// Output points. 62 | public override List Process(Mat img, List srcPoints, List dstPoints = null, bool drawDebugPoints = false) 63 | { 64 | if (srcPoints != null && srcPoints.Count != numberOfElements) 65 | { 66 | throw new ArgumentException("The number of elements is different."); 67 | } 68 | 69 | if (srcPoints != null) 70 | { 71 | 72 | if (dstPoints == null) 73 | { 74 | dstPoints = new List(); 75 | } 76 | if (dstPoints != null && dstPoints.Count != numberOfElements) 77 | { 78 | dstPoints.Clear(); 79 | for (int i = 0; i < numberOfElements; i++) 80 | { 81 | dstPoints.Add(new Vector2()); 82 | } 83 | } 84 | 85 | for (int i = 0; i < numberOfElements; i++) 86 | { 87 | src_points[i].x = srcPoints[i].x; 88 | src_points[i].y = srcPoints[i].y; 89 | } 90 | 91 | // clac diffDlib 92 | prevTrackPtsMat.fromList(src_points); 93 | OpenCVForUnity.CoreModule.Rect rect = Imgproc.boundingRect(prevTrackPtsMat); 94 | double diffDlib = this.diffDlib * rect.area() / 40000.0 * diffCheckSensitivity; 95 | 96 | // if the face is moving so fast, use dlib to detect the face 97 | double diff = calDistanceDiff(src_points, last_points); 98 | if (drawDebugPoints) 99 | Debug.Log("variance:" + diff); 100 | if (diff > diffDlib) 101 | { 102 | for (int i = 0; i < numberOfElements; i++) 103 | { 104 | dstPoints[i] = srcPoints[i]; 105 | } 106 | 107 | if (drawDebugPoints) 108 | { 109 | Debug.Log("DLIB"); 110 | for (int i = 0; i < numberOfElements; i++) 111 | { 112 | Imgproc.circle(img, new Point(srcPoints[i].x, srcPoints[i].y), 2, new Scalar(255, 0, 0, 255), -1); 113 | } 114 | } 115 | 116 | flag = false; 117 | } 118 | else 119 | { 120 | if (!flag) 121 | { 122 | // Set initial state estimate. 123 | Mat statePreMat = KF.get_statePre(); 124 | float[] tmpStatePre = new float[statePreMat.total()]; 125 | for (int i = 0; i < numberOfElements; i++) 126 | { 127 | tmpStatePre[i * 2] = (float)srcPoints[i].x; 128 | tmpStatePre[i * 2 + 1] = (float)srcPoints[i].y; 129 | } 130 | statePreMat.put(0, 0, tmpStatePre); 131 | Mat statePostMat = KF.get_statePost(); 132 | float[] tmpStatePost = new float[statePostMat.total()]; 133 | for (int i = 0; i < numberOfElements; i++) 134 | { 135 | tmpStatePost[i * 2] = (float)srcPoints[i].x; 136 | tmpStatePost[i * 2 + 1] = (float)srcPoints[i].y; 137 | } 138 | statePostMat.put(0, 0, tmpStatePost); 139 | 140 | flag = true; 141 | } 142 | 143 | // Kalman Prediction 144 | KF.predict(); 145 | 146 | // Update Measurement 147 | float[] tmpMeasurement = new float[measurement.total()]; 148 | for (int i = 0; i < numberOfElements; i++) 149 | { 150 | tmpMeasurement[i * 2] = (float)srcPoints[i].x; 151 | tmpMeasurement[i * 2 + 1] = (float)srcPoints[i].y; 152 | } 153 | measurement.put(0, 0, tmpMeasurement); 154 | 155 | // Correct Measurement 156 | Mat estimated = KF.correct(measurement); 157 | float[] tmpEstimated = new float[estimated.total()]; 158 | estimated.get(0, 0, tmpEstimated); 159 | for (int i = 0; i < numberOfElements; i++) 160 | { 161 | predict_points[i].x = tmpEstimated[i * 2]; 162 | predict_points[i].y = tmpEstimated[i * 2 + 1]; 163 | } 164 | estimated.Dispose(); 165 | 166 | for (int i = 0; i < numberOfElements; i++) 167 | { 168 | dstPoints[i] = new Vector2((float)predict_points[i].x, (float)predict_points[i].y); 169 | } 170 | 171 | if (drawDebugPoints) 172 | { 173 | Debug.Log("Kalman Filter"); 174 | for (int i = 0; i < numberOfElements; i++) 175 | { 176 | Imgproc.circle(img, predict_points[i], 2, new Scalar(0, 255, 0, 255), -1); 177 | } 178 | } 179 | } 180 | 181 | for (int i = 0; i < numberOfElements; i++) 182 | { 183 | last_points[i].x = src_points[i].x; 184 | last_points[i].y = src_points[i].y; 185 | } 186 | 187 | return dstPoints; 188 | } 189 | else 190 | { 191 | return dstPoints == null ? srcPoints : dstPoints; 192 | } 193 | } 194 | 195 | /// 196 | /// Resets filter. 197 | /// 198 | public override void Reset() 199 | { 200 | flag = false; 201 | 202 | // Reset Kalman Filter 203 | for (int i = 0; i < numberOfElements; i++) 204 | { 205 | predict_points[i].x = 0.0; 206 | predict_points[i].y = 0.0; 207 | } 208 | } 209 | 210 | /// 211 | /// To release the resources for the initialized method. 212 | /// 213 | public override void Dispose() 214 | { 215 | if (src_points != null) 216 | src_points.Clear(); 217 | 218 | DisposeKalmanFilter(); 219 | 220 | if (prevTrackPtsMat != null) 221 | prevTrackPtsMat.Dispose(); 222 | } 223 | 224 | protected virtual void InitializeKalmanFilter() 225 | { 226 | predict_points = new List(); 227 | for (int i = 0; i < numberOfElements; i++) 228 | { 229 | predict_points.Add(new Point(0.0, 0.0)); 230 | } 231 | 232 | KF = new KalmanFilter(stateNum, measureNum, 0, CvType.CV_32F); 233 | measurement = Mat.zeros(measureNum, 1, CvType.CV_32F); 234 | 235 | // Generate the Measurement Matrix 236 | KF.set_transitionMatrix(Mat.zeros(stateNum, stateNum, CvType.CV_32F)); 237 | for (int i = 0; i < stateNum; i++) 238 | { 239 | for (int j = 0; j < stateNum; j++) 240 | { 241 | if (i == j || (j - measureNum) == i) 242 | { 243 | KF.get_transitionMatrix().put(i, j, new float[] { 1.0f }); 244 | } 245 | else 246 | { 247 | KF.get_transitionMatrix().put(i, j, new float[] { 0.0f }); 248 | } 249 | } 250 | } 251 | 252 | // measurement matrix (H) 253 | Core.setIdentity(KF.get_measurementMatrix()); 254 | // process noise covariance matrix (Q) 255 | Core.setIdentity(KF.get_processNoiseCov(), Scalar.all(1e-5)); 256 | // measurement noise covariance matrix (R) 257 | Core.setIdentity(KF.get_measurementNoiseCov(), Scalar.all(1e-1)); 258 | // posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k) 259 | Core.setIdentity(KF.get_errorCovPost(), Scalar.all(0.1)); 260 | } 261 | 262 | protected virtual void DisposeKalmanFilter() 263 | { 264 | if (predict_points != null) 265 | predict_points.Clear(); 266 | if (KF != null) 267 | KF.Dispose(); 268 | if (measurement != null) 269 | measurement.Dispose(); 270 | } 271 | } 272 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/KFPointsFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7681beef1b814c4aa6ad66833ad434b 3 | timeCreated: 1523287103 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/LowPassPointsFilter.cs: -------------------------------------------------------------------------------- 1 | using OpenCVForUnity.CoreModule; 2 | using OpenCVForUnity.ImgprocModule; 3 | using System; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 8 | { 9 | /// 10 | /// Low Pass Points Filter. 11 | /// v 1.0.4 12 | /// 13 | public class LowPassPointsFilter : PointsFilterBase 14 | { 15 | public double diffLawPass = 2; 16 | 17 | bool flag = false; 18 | 19 | List lastPoints; 20 | 21 | public LowPassPointsFilter(int numberOfElements) : base(numberOfElements) 22 | { 23 | lastPoints = new List(); 24 | for (int i = 0; i < numberOfElements; i++) 25 | { 26 | lastPoints.Add(new Vector2()); 27 | } 28 | } 29 | 30 | /// 31 | /// Processes points by filter. 32 | /// 33 | /// Image mat. 34 | /// Input points. 35 | /// Output points. 36 | /// if true, draws debug points. 37 | /// Output points. 38 | public override List Process(Mat img, List srcPoints, List dstPoints = null, bool drawDebugPoints = false) 39 | { 40 | if (srcPoints != null && srcPoints.Count != numberOfElements) 41 | { 42 | throw new ArgumentException("The number of elements is different."); 43 | } 44 | 45 | if (srcPoints != null) 46 | { 47 | 48 | if (dstPoints == null) 49 | { 50 | dstPoints = new List(); 51 | } 52 | if (dstPoints != null && dstPoints.Count != numberOfElements) 53 | { 54 | dstPoints.Clear(); 55 | for (int i = 0; i < numberOfElements; i++) 56 | { 57 | dstPoints.Add(new Vector2()); 58 | } 59 | } 60 | 61 | if (flag) 62 | { 63 | for (int i = 0; i < numberOfElements; i++) 64 | { 65 | double diff = Math.Sqrt(Math.Pow(srcPoints[i].x - lastPoints[i].x, 2.0) + Math.Pow(srcPoints[i].y - lastPoints[i].y, 2.0)); 66 | if (diff > diffLawPass) 67 | { 68 | lastPoints[i] = srcPoints[i]; 69 | if (drawDebugPoints) 70 | Imgproc.circle(img, new Point(srcPoints[i].x, srcPoints[i].y), 1, new Scalar(0, 255, 0, 255), -1); 71 | } 72 | else 73 | { 74 | if (drawDebugPoints) 75 | Imgproc.circle(img, new Point(lastPoints[i].x, lastPoints[i].y), 1, new Scalar(255, 0, 0, 255), -1); 76 | } 77 | dstPoints[i] = lastPoints[i]; 78 | } 79 | } 80 | else 81 | { 82 | for (int i = 0; i < numberOfElements; i++) 83 | { 84 | lastPoints[i] = srcPoints[i]; 85 | dstPoints[i] = srcPoints[i]; 86 | } 87 | if (drawDebugPoints) 88 | { 89 | for (int i = 0; i < numberOfElements; i++) 90 | { 91 | Imgproc.circle(img, new Point(srcPoints[i].x, srcPoints[i].y), 1, new Scalar(0, 0, 255, 255), -1); 92 | } 93 | } 94 | flag = true; 95 | } 96 | return dstPoints; 97 | } 98 | else 99 | { 100 | return dstPoints == null ? srcPoints : dstPoints; 101 | } 102 | } 103 | 104 | /// 105 | /// Resets filter. 106 | /// 107 | public override void Reset() 108 | { 109 | flag = false; 110 | for (int i = 0; i < lastPoints.Count; i++) 111 | { 112 | lastPoints[i] = new Vector2(); 113 | } 114 | } 115 | 116 | /// 117 | /// To release the resources for the initialized method. 118 | /// 119 | public override void Dispose() 120 | { 121 | if (lastPoints != null) 122 | lastPoints.Clear(); 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/LowPassPointsFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 714742db5737d6c49b2b9c7d31d1ce27 3 | timeCreated: 1523552930 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/OFPointsFilter.cs: -------------------------------------------------------------------------------- 1 | using OpenCVForUnity.CoreModule; 2 | using OpenCVForUnity.ImgprocModule; 3 | using OpenCVForUnity.VideoModule; 4 | using System; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 9 | { 10 | /// 11 | /// Optical Flow Points Filter. 12 | /// v 1.0.4 13 | /// 14 | public class OFPointsFilter : PointsFilterBase 15 | { 16 | public double diffCheckSensitivity = 1; 17 | 18 | bool flag = false; 19 | double diffDlib = 1; 20 | MatOfPoint prevTrackPtsMat; 21 | 22 | // Optical Flow 23 | Mat prevgray, gray; 24 | List prevTrackPts; 25 | List nextTrackPts; 26 | MatOfPoint2f mOP2fPrevTrackPts; 27 | MatOfPoint2f mOP2fNextTrackPts; 28 | MatOfByte status; 29 | MatOfFloat err; 30 | 31 | public OFPointsFilter(int numberOfElements) : base(numberOfElements) 32 | { 33 | diffDlib = diffDlib * (double)numberOfElements / 68.0; 34 | prevTrackPtsMat = new MatOfPoint(); 35 | 36 | // Initialize Optical Flow 37 | InitializeOpticalFlow(); 38 | } 39 | 40 | /// 41 | /// Processes points by filter. 42 | /// 43 | /// Image mat. 44 | /// Input points. 45 | /// Output points. 46 | /// if true, draws debug points. 47 | /// Output points. 48 | public override List Process(Mat img, List srcPoints, List dstPoints = null, bool drawDebugPoints = false) 49 | { 50 | if (srcPoints != null && srcPoints.Count != numberOfElements) 51 | { 52 | throw new ArgumentException("The number of elements is different."); 53 | } 54 | 55 | if (srcPoints == null) 56 | { 57 | return dstPoints == null ? srcPoints : dstPoints; 58 | } 59 | 60 | if (!flag) 61 | { 62 | if (img.channels() == 4) 63 | { 64 | Imgproc.cvtColor(img, prevgray, Imgproc.COLOR_RGBA2GRAY); 65 | } 66 | else if (img.channels() == 3) 67 | { 68 | Imgproc.cvtColor(img, prevgray, Imgproc.COLOR_RGB2GRAY); 69 | } 70 | else 71 | { 72 | if (prevgray.total() == 0) 73 | { 74 | prevgray = img.clone(); 75 | } 76 | else 77 | { 78 | img.copyTo(prevgray); 79 | } 80 | } 81 | 82 | for (int i = 0; i < numberOfElements; i++) 83 | { 84 | prevTrackPts[i] = new Point(srcPoints[i].x, srcPoints[i].y); 85 | } 86 | 87 | flag = true; 88 | } 89 | 90 | if (srcPoints != null) 91 | { 92 | 93 | if (dstPoints == null) 94 | { 95 | dstPoints = new List(); 96 | } 97 | if (dstPoints != null && dstPoints.Count != numberOfElements) 98 | { 99 | dstPoints.Clear(); 100 | for (int i = 0; i < numberOfElements; i++) 101 | { 102 | dstPoints.Add(new Vector2()); 103 | } 104 | } 105 | 106 | if (img.channels() == 4) 107 | { 108 | Imgproc.cvtColor(img, gray, Imgproc.COLOR_RGBA2GRAY); 109 | } 110 | else if (img.channels() == 3) 111 | { 112 | Imgproc.cvtColor(img, gray, Imgproc.COLOR_RGB2GRAY); 113 | } 114 | else 115 | { 116 | if (gray.total() == 0) 117 | { 118 | gray = img.clone(); 119 | } 120 | else 121 | { 122 | img.copyTo(gray); 123 | } 124 | } 125 | 126 | if (prevgray.total() > 0) 127 | { 128 | mOP2fPrevTrackPts.fromList(prevTrackPts); 129 | mOP2fNextTrackPts.fromList(nextTrackPts); 130 | Video.calcOpticalFlowPyrLK(prevgray, gray, mOP2fPrevTrackPts, mOP2fNextTrackPts, status, err); 131 | prevTrackPts = mOP2fPrevTrackPts.toList(); 132 | nextTrackPts = mOP2fNextTrackPts.toList(); 133 | 134 | // clac diffDlib 135 | prevTrackPtsMat.fromList(prevTrackPts); 136 | OpenCVForUnity.CoreModule.Rect rect = Imgproc.boundingRect(prevTrackPtsMat); 137 | double diffDlib = this.diffDlib * rect.area() / 40000.0 * diffCheckSensitivity; 138 | 139 | // if the face is moving so fast, use dlib to detect the face 140 | double diff = calDistanceDiff(prevTrackPts, nextTrackPts); 141 | if (drawDebugPoints) 142 | Debug.Log("variance:" + diff); 143 | if (diff > diffDlib) 144 | { 145 | for (int i = 0; i < numberOfElements; i++) 146 | { 147 | nextTrackPts[i].x = srcPoints[i].x; 148 | nextTrackPts[i].y = srcPoints[i].y; 149 | 150 | dstPoints[i] = srcPoints[i]; 151 | } 152 | 153 | if (drawDebugPoints) 154 | { 155 | Debug.Log("DLIB"); 156 | for (int i = 0; i < numberOfElements; i++) 157 | { 158 | Imgproc.circle(img, new Point(srcPoints[i].x, srcPoints[i].y), 2, new Scalar(255, 0, 0, 255), -1); 159 | } 160 | } 161 | } 162 | else 163 | { 164 | // In this case, use Optical Flow 165 | for (int i = 0; i < numberOfElements; i++) 166 | { 167 | dstPoints[i] = new Vector2((float)nextTrackPts[i].x, (float)nextTrackPts[i].y); 168 | } 169 | 170 | if (drawDebugPoints) 171 | { 172 | Debug.Log("Optical Flow"); 173 | for (int i = 0; i < numberOfElements; i++) 174 | { 175 | Imgproc.circle(img, nextTrackPts[i], 2, new Scalar(0, 0, 255, 255), -1); 176 | } 177 | } 178 | } 179 | } 180 | Swap(ref prevTrackPts, ref nextTrackPts); 181 | Swap(ref prevgray, ref gray); 182 | } 183 | return dstPoints; 184 | } 185 | 186 | /// 187 | /// Resets filter. 188 | /// 189 | public override void Reset() 190 | { 191 | flag = false; 192 | 193 | // Reset Optical Flow 194 | for (int i = 0; i < numberOfElements; i++) 195 | { 196 | prevTrackPts[i].x = 0.0; 197 | prevTrackPts[i].y = 0.0; 198 | } 199 | for (int i = 0; i < numberOfElements; i++) 200 | { 201 | nextTrackPts[i].x = 0.0; 202 | nextTrackPts[i].y = 0.0; 203 | } 204 | 205 | if (prevgray != null) 206 | { 207 | prevgray.Dispose(); 208 | prevgray = new Mat(); 209 | } 210 | if (gray != null) 211 | { 212 | gray.Dispose(); 213 | gray = new Mat(); 214 | } 215 | } 216 | 217 | /// 218 | /// To release the resources for the initialized method. 219 | /// 220 | public override void Dispose() 221 | { 222 | DisposeOpticalFlow(); 223 | 224 | if (prevTrackPtsMat != null) 225 | prevTrackPtsMat.Dispose(); 226 | } 227 | 228 | protected virtual void InitializeOpticalFlow() 229 | { 230 | prevTrackPts = new List(); 231 | for (int i = 0; i < numberOfElements; i++) 232 | { 233 | prevTrackPts.Add(new Point(0, 0)); 234 | } 235 | nextTrackPts = new List(); 236 | for (int i = 0; i < numberOfElements; i++) 237 | { 238 | nextTrackPts.Add(new Point(0, 0)); 239 | } 240 | prevgray = new Mat(); 241 | gray = new Mat(); 242 | mOP2fPrevTrackPts = new MatOfPoint2f(); 243 | mOP2fNextTrackPts = new MatOfPoint2f(); 244 | status = new MatOfByte(); 245 | err = new MatOfFloat(); 246 | } 247 | 248 | protected virtual void DisposeOpticalFlow() 249 | { 250 | if (prevTrackPts != null) 251 | prevTrackPts.Clear(); 252 | if (nextTrackPts != null) 253 | nextTrackPts.Clear(); 254 | if (prevgray != null) 255 | prevgray.Dispose(); 256 | if (gray != null) 257 | gray.Dispose(); 258 | if (mOP2fPrevTrackPts != null) 259 | mOP2fPrevTrackPts.Dispose(); 260 | if (mOP2fNextTrackPts != null) 261 | mOP2fNextTrackPts.Dispose(); 262 | if (status != null) 263 | status.Dispose(); 264 | if (err != null) 265 | err.Dispose(); 266 | } 267 | } 268 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/OFPointsFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a0852a40944ebb4fb13482305850174 3 | timeCreated: 1523287103 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/PointsFilterBase.cs: -------------------------------------------------------------------------------- 1 | using OpenCVForUnity.CoreModule; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 7 | { 8 | /// 9 | /// Points Filter Base. 10 | /// v 1.0.4 11 | /// 12 | public abstract class PointsFilterBase 13 | { 14 | protected int numberOfElements; 15 | 16 | public PointsFilterBase(int numberOfElements) 17 | { 18 | this.numberOfElements = numberOfElements; 19 | } 20 | 21 | /// 22 | /// Processes points by filter. 23 | /// 24 | /// Image mat. 25 | /// Input points. 26 | /// Output points. 27 | /// if true, draws debug points. 28 | /// Output points. 29 | public abstract List Process(Mat img, List srcPoints, List dstPoints = null, bool drawDebugPoints = false); 30 | 31 | /// 32 | /// Resets filter. 33 | /// 34 | public abstract void Reset(); 35 | 36 | /// 37 | /// To release the resources for the initialized method. 38 | /// 39 | public abstract void Dispose(); 40 | 41 | // This function is to calculate the variance 42 | protected virtual double calDistanceDiff(IList curPoints, IList lastPoints) 43 | { 44 | double variance = 0.0; 45 | double sum = 0.0; 46 | List diffs = new List(); 47 | if (curPoints.Count == lastPoints.Count) 48 | { 49 | for (int i = 0; i < curPoints.Count; i++) 50 | { 51 | double diff = Math.Sqrt(Math.Pow(curPoints[i].x - lastPoints[i].x, 2.0) + Math.Pow(curPoints[i].y - lastPoints[i].y, 2.0)); 52 | sum += diff; 53 | diffs.Add(diff); 54 | } 55 | double mean = sum / diffs.Count; 56 | for (int i = 0; i < curPoints.Count; i++) 57 | { 58 | variance += Math.Pow(diffs[i] - mean, 2); 59 | } 60 | return variance / diffs.Count; 61 | } 62 | return variance; 63 | } 64 | 65 | protected virtual void Swap(ref T a, ref T b) 66 | { 67 | var t = a; 68 | a = b; 69 | b = t; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/NoiseFilter/PointsFilterBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f813007fd62470549af1c8c4b9a6b08c 3 | timeCreated: 1523198082 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/VideoCaptureNoiseFilterExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6776ab0e8adfbef48b431769e6b240de 3 | timeCreated: 1523119744 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/NoiseFilterExample/WebCamTextureNoiseFilterExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd325778b3bb2f640bd89ea13ae10961 3 | timeCreated: 1523228018 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/OpenCVForUnityUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 126021adab3ae5d4db76ea2d25246916 3 | timeCreated: 1460794221 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ShowLicense.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.SceneManagement; 3 | 4 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 5 | { 6 | public class ShowLicense : MonoBehaviour 7 | { 8 | // Use this for initialization 9 | void Start() 10 | { 11 | 12 | } 13 | 14 | // Update is called once per frame 15 | void Update() 16 | { 17 | 18 | } 19 | 20 | /// 21 | /// Raises the back button click event. 22 | /// 23 | public void OnBackButtonClick() 24 | { 25 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ShowLicense.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c27c4859b593fb4cb68de20c5cf67ed 3 | timeCreated: 1461439312 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/ShowLicense.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 142ccac5abe333645be0699fbe033a2e 3 | timeCreated: 1461439312 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Texture2DToMatExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d0cb87ee75c892498977bff79681781 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Texture2DToMatExample/Texture2DToMatExample.cs: -------------------------------------------------------------------------------- 1 | using DlibFaceLandmarkDetector; 2 | using OpenCVForUnity.CoreModule; 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | using UnityEngine; 6 | using UnityEngine.SceneManagement; 7 | using UnityEngine.UI; 8 | 9 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 10 | { 11 | /// 12 | /// Texture2DToMat Example 13 | /// An example of using "Dlib FaceLandmark Detector" together with "OpenCV for Unity". 14 | /// 15 | public class Texture2DToMatExample : MonoBehaviour 16 | { 17 | [Header("Output")] 18 | /// 19 | /// The RawImage for previewing the result. 20 | /// 21 | public RawImage resultPreview; 22 | 23 | [Space(10)] 24 | 25 | /// 26 | /// The image texture. 27 | /// 28 | public Texture2D imgTexture; 29 | 30 | /// 31 | /// The FPS monitor. 32 | /// 33 | FpsMonitor fpsMonitor; 34 | 35 | /// 36 | /// The dlib shape predictor file name. 37 | /// 38 | string dlibShapePredictorFileName = "DlibFaceLandmarkDetector/sp_human_face_68.dat"; 39 | 40 | /// 41 | /// The dlib shape predictor file path. 42 | /// 43 | string dlibShapePredictorFilePath; 44 | 45 | /// 46 | /// The CancellationTokenSource. 47 | /// 48 | CancellationTokenSource cts = new CancellationTokenSource(); 49 | 50 | // Use this for initialization 51 | async void Start() 52 | { 53 | fpsMonitor = GetComponent(); 54 | 55 | dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName; 56 | 57 | // Asynchronously retrieves the readable file path from the StreamingAssets directory. 58 | if (fpsMonitor != null) 59 | fpsMonitor.consoleText = "Preparing file access..."; 60 | 61 | dlibShapePredictorFilePath = await DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsyncTask(dlibShapePredictorFileName, cancellationToken: cts.Token); 62 | 63 | if (fpsMonitor != null) 64 | fpsMonitor.consoleText = ""; 65 | 66 | Run(); 67 | } 68 | 69 | private void Run() 70 | { 71 | if (string.IsNullOrEmpty(dlibShapePredictorFilePath)) 72 | { 73 | Debug.LogError("shape predictor file does not exist. Please copy from “DlibFaceLandmarkDetector/StreamingAssets/DlibFaceLandmarkDetector/” to “Assets/StreamingAssets/DlibFaceLandmarkDetector/” folder. "); 74 | } 75 | 76 | Mat imgMat = new Mat(imgTexture.height, imgTexture.width, CvType.CV_8UC4); 77 | 78 | // Convert Unity Texture2D to OpenCV Mat. 79 | OpenCVForUnity.UnityUtils.Utils.texture2DToMat(imgTexture, imgMat); 80 | Debug.Log("imgMat dst ToString " + imgMat.ToString()); 81 | 82 | 83 | FaceLandmarkDetector faceLandmarkDetector = new FaceLandmarkDetector(dlibShapePredictorFilePath); 84 | 85 | OpenCVForUnityUtils.SetImage(faceLandmarkDetector, imgMat); 86 | 87 | 88 | //detect face rectdetecton 89 | List detectResult = faceLandmarkDetector.DetectRectDetection(); 90 | 91 | foreach (var result in detectResult) 92 | { 93 | Debug.Log("rect : " + result.rect); 94 | Debug.Log("detection_confidence : " + result.detection_confidence); 95 | Debug.Log("weight_index : " + result.weight_index); 96 | 97 | //detect landmark points 98 | List points = faceLandmarkDetector.DetectLandmark(result.rect); 99 | 100 | Debug.Log("face points count : " + points.Count); 101 | //draw landmark points 102 | OpenCVForUnityUtils.DrawFaceLandmark(imgMat, points, new Scalar(0, 255, 0, 255), 2, true); 103 | 104 | //draw face rect 105 | OpenCVForUnityUtils.DrawFaceRect(imgMat, result, new Scalar(255, 0, 0, 255), 2); 106 | } 107 | 108 | faceLandmarkDetector.Dispose(); 109 | 110 | Texture2D texture = new Texture2D(imgMat.cols(), imgMat.rows(), TextureFormat.RGBA32, false); 111 | 112 | // Convert OpenCV Mat to Unity Texture2D. 113 | OpenCVForUnity.UnityUtils.Utils.matToTexture2D(imgMat, texture); 114 | 115 | resultPreview.texture = texture; 116 | resultPreview.GetComponent().aspectRatio = (float)texture.width / texture.height; 117 | 118 | 119 | if (fpsMonitor != null) 120 | { 121 | fpsMonitor.Add("dlib shape predictor", dlibShapePredictorFileName); 122 | fpsMonitor.Add("width", imgMat.width().ToString()); 123 | fpsMonitor.Add("height", imgMat.height().ToString()); 124 | fpsMonitor.Add("orientation", Screen.orientation.ToString()); 125 | } 126 | } 127 | 128 | // Update is called once per frame 129 | void Update() 130 | { 131 | 132 | } 133 | 134 | /// 135 | /// Raises the destroy event. 136 | /// 137 | void OnDestroy() 138 | { 139 | if (cts != null) 140 | cts.Dispose(); 141 | } 142 | 143 | /// 144 | /// Raises the back button click event. 145 | /// 146 | public void OnBackButtonClick() 147 | { 148 | SceneManager.LoadScene("DlibFaceLandmarkDetectorExample"); 149 | } 150 | } 151 | } -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Texture2DToMatExample/Texture2DToMatExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bac11c89abccaa642aa669c7408063d8 3 | timeCreated: 1461438141 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Texture2DToMatExample/Texture2DToMatExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6404ee80aef06c44b8125d6fa804ccb5 3 | timeCreated: 1461438140 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b6f321e961875046b6d7a9d9195a34d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/FpsMonitor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecc5fee4c03849d4e83eb78e020e6861 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/FpsMonitor/FpsMonitor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 6 | { 7 | // v1.0.3 8 | public class FpsMonitor : MonoBehaviour 9 | { 10 | int tick = 0; 11 | float elapsed = 0; 12 | float fps = 0; 13 | 14 | public enum Alignment 15 | { 16 | LeftTop, 17 | RightTop, 18 | LeftBottom, 19 | RightBottom, 20 | } 21 | 22 | public Alignment alignment = Alignment.RightTop; 23 | 24 | const float GUI_WIDTH = 95f; 25 | const float GUI_HEIGHT = 35f; 26 | const float MARGIN_X = 10f; 27 | const float MARGIN_Y = 10f; 28 | const float INNER_X = 10f; 29 | const float INNER_Y = 10f; 30 | const float GUI_CONSOLE_HEIGHT = 100f; 31 | 32 | public Vector2 offset = new Vector2(MARGIN_X, MARGIN_Y); 33 | public bool boxVisible = true; 34 | public float boxWidth = GUI_WIDTH; 35 | public float boxHeight = GUI_HEIGHT; 36 | public Vector2 padding = new Vector2(INNER_X, INNER_Y); 37 | public float consoleHeight = GUI_CONSOLE_HEIGHT; 38 | 39 | private Text fpsTextComponent; 40 | private Text consoleTextComponent; 41 | private GameObject fpsPanel; 42 | private GameObject consolePanel; 43 | private Canvas canvas; 44 | 45 | Dictionary outputDict = new Dictionary(); 46 | 47 | protected string _consoleText = null; 48 | public virtual string consoleText 49 | { 50 | get { return _consoleText; } 51 | set 52 | { 53 | _consoleText = value; 54 | toast_time = -1; 55 | UpdateConsoleText(); 56 | } 57 | } 58 | 59 | float toast_time = -1; // Managed in milliseconds 60 | 61 | // Additional: Reference to the background Image GameObject 62 | private GameObject fpsBackgroundObj; 63 | private GameObject consoleBackgroundObj; 64 | 65 | private bool _needsUpdate = false; 66 | private bool _isInitialized = false; 67 | 68 | // Path to the prefab 69 | private const string CANVAS_PREFAB_PATH = "FpsMonitorCanvas_103"; 70 | 71 | // Lifecycle methods 72 | void Awake() 73 | { 74 | LoadCanvasFromPrefab(); 75 | LocateUI(); 76 | _isInitialized = true; 77 | _needsUpdate = true; 78 | } 79 | 80 | void LoadCanvasFromPrefab() 81 | { 82 | // Load Canvas from Prefab 83 | GameObject prefab = Resources.Load(CANVAS_PREFAB_PATH); 84 | if (prefab == null) 85 | { 86 | Debug.LogError($"Failed to load FpsMonitorCanvas prefab from {CANVAS_PREFAB_PATH}"); 87 | return; 88 | } 89 | 90 | // Instantiate Canvas 91 | GameObject canvasObj = Instantiate(prefab); 92 | // Set the name to the part before the first underscore (if any) 93 | int underscoreIndex = prefab.name.IndexOf('_'); 94 | if (underscoreIndex > 0) 95 | canvasObj.name = prefab.name.Substring(0, underscoreIndex); 96 | else 97 | canvasObj.name = prefab.name; 98 | canvas = canvasObj.GetComponent(); 99 | if (canvas == null) 100 | { 101 | Debug.LogError("FpsMonitorCanvas prefab does not have a Canvas component"); 102 | return; 103 | } 104 | 105 | // Get references to required components 106 | fpsPanel = canvasObj.transform.Find("FpsPanel")?.gameObject; 107 | consolePanel = canvasObj.transform.Find("ConsolePanel")?.gameObject; 108 | 109 | if (fpsPanel != null) 110 | { 111 | fpsTextComponent = fpsPanel.transform.Find("Mask/FpsText")?.GetComponent(); 112 | fpsBackgroundObj = fpsPanel.transform.Find("Mask/Background")?.gameObject; 113 | } 114 | 115 | if (consolePanel != null) 116 | { 117 | consoleTextComponent = consolePanel.transform.Find("Mask/ConsoleText")?.GetComponent(); 118 | consoleBackgroundObj = consolePanel.transform.Find("Mask/Background")?.gameObject; 119 | } 120 | 121 | // Initial display settings 122 | if (fpsPanel != null) fpsPanel.SetActive(true); 123 | if (consolePanel != null) consolePanel.SetActive(false); 124 | 125 | // Show/hide background 126 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 127 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 128 | } 129 | 130 | void OnDestroy() 131 | { 132 | if (canvas != null) 133 | { 134 | Destroy(canvas.gameObject); 135 | } 136 | } 137 | 138 | // Update method 139 | void Update() 140 | { 141 | tick++; 142 | elapsed += Time.deltaTime; 143 | if (elapsed >= 1f) 144 | { 145 | fps = tick / elapsed; 146 | tick = 0; 147 | elapsed = 0; 148 | UpdateFpsText(); 149 | } 150 | 151 | if (toast_time > 0) 152 | { 153 | toast_time -= Time.deltaTime * 1000; // Decrement in milliseconds 154 | if (toast_time <= 0) 155 | { 156 | _consoleText = ""; 157 | UpdateConsoleText(); 158 | } 159 | } 160 | 161 | if (_needsUpdate) 162 | { 163 | _needsUpdate = false; 164 | UpdateUI(); 165 | } 166 | } 167 | 168 | void OnValidate() 169 | { 170 | if (Application.isPlaying) 171 | { 172 | _needsUpdate = true; 173 | } 174 | } 175 | 176 | // UI-related methods 177 | void LocateUI() 178 | { 179 | if (fpsPanel == null || consolePanel == null) return; 180 | 181 | // Set FPS panel position 182 | var fpsRect = fpsPanel.GetComponent(); 183 | switch (alignment) 184 | { 185 | case Alignment.LeftTop: 186 | fpsRect.anchorMin = new Vector2(0, 1); 187 | fpsRect.anchorMax = new Vector2(0, 1); 188 | fpsRect.pivot = new Vector2(0, 1); 189 | fpsRect.anchoredPosition = new Vector2(offset.x, -offset.y); 190 | break; 191 | case Alignment.RightTop: 192 | fpsRect.anchorMin = new Vector2(1, 1); 193 | fpsRect.anchorMax = new Vector2(1, 1); 194 | fpsRect.pivot = new Vector2(1, 1); 195 | fpsRect.anchoredPosition = new Vector2(-offset.x, -offset.y); 196 | break; 197 | case Alignment.LeftBottom: 198 | fpsRect.anchorMin = new Vector2(0, 0); 199 | fpsRect.anchorMax = new Vector2(0, 0); 200 | fpsRect.pivot = new Vector2(0, 0); 201 | fpsRect.anchoredPosition = new Vector2(offset.x, offset.y); 202 | break; 203 | case Alignment.RightBottom: 204 | fpsRect.anchorMin = new Vector2(1, 0); 205 | fpsRect.anchorMax = new Vector2(1, 0); 206 | fpsRect.pivot = new Vector2(1, 0); 207 | fpsRect.anchoredPosition = new Vector2(-offset.x, offset.y); 208 | break; 209 | } 210 | 211 | // Set console panel position 212 | var consoleRect = consolePanel.GetComponent(); 213 | consoleRect.anchorMin = new Vector2(0, 0); 214 | consoleRect.anchorMax = new Vector2(1, 0); 215 | consoleRect.pivot = new Vector2(0.5f, 0); 216 | consoleRect.offsetMin = new Vector2(offset.x, offset.y); 217 | consoleRect.offsetMax = new Vector2(-offset.x, offset.y + consoleHeight); 218 | 219 | // Show/hide background 220 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 221 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 222 | } 223 | 224 | void UpdateUI() 225 | { 226 | if (fpsPanel != null) 227 | { 228 | var rectTransform = fpsPanel.GetComponent(); 229 | rectTransform.sizeDelta = new Vector2(boxWidth, boxHeight); 230 | 231 | // Update FPS text padding 232 | var fpsTextTransform = fpsTextComponent?.GetComponent(); 233 | if (fpsTextTransform != null) 234 | { 235 | fpsTextTransform.offsetMin = new Vector2(padding.x, padding.y); 236 | fpsTextTransform.offsetMax = new Vector2(-padding.x, -padding.y); 237 | } 238 | } 239 | 240 | if (consolePanel != null) 241 | { 242 | var rectTransform = consolePanel.GetComponent(); 243 | rectTransform.sizeDelta = new Vector2(Screen.width - offset.x * 2, consoleHeight); 244 | 245 | // Update console text padding 246 | var consoleTextTransform = consoleTextComponent?.GetComponent(); 247 | if (consoleTextTransform != null) 248 | { 249 | consoleTextTransform.offsetMin = new Vector2(padding.x, padding.y); 250 | consoleTextTransform.offsetMax = new Vector2(-padding.x, -padding.y); 251 | } 252 | } 253 | 254 | // Update show/hide background 255 | if (fpsBackgroundObj != null) fpsBackgroundObj.SetActive(boxVisible); 256 | if (consoleBackgroundObj != null) consoleBackgroundObj.SetActive(boxVisible); 257 | 258 | // Update panel position 259 | LocateUI(); 260 | } 261 | 262 | // Text update methods 263 | void UpdateFpsText() 264 | { 265 | if (fpsTextComponent == null) return; 266 | 267 | // Display FPS value directly 268 | string text = $"fps : {fps:F1}"; 269 | 270 | // Add only if there is additional information 271 | if (outputDict.Count > 0) 272 | { 273 | foreach (KeyValuePair pair in outputDict) 274 | { 275 | text += $"\n{pair.Key} : {pair.Value}"; 276 | } 277 | } 278 | 279 | fpsTextComponent.text = text; 280 | fpsTextComponent.enabled = true; 281 | fpsTextComponent.gameObject.SetActive(true); 282 | } 283 | 284 | void UpdateConsoleText() 285 | { 286 | if (consoleTextComponent == null || consolePanel == null) 287 | { 288 | Debug.LogWarning("UpdateConsoleText: consoleTextComponent or consolePanel is null"); 289 | return; 290 | } 291 | 292 | if (!string.IsNullOrEmpty(_consoleText) && toast_time != 0) 293 | { 294 | consoleTextComponent.text = _consoleText; 295 | consolePanel.SetActive(true); 296 | consoleTextComponent.gameObject.SetActive(true); 297 | } 298 | else 299 | { 300 | consoleTextComponent.text = ""; 301 | consolePanel.SetActive(false); 302 | consoleTextComponent.gameObject.SetActive(false); 303 | } 304 | } 305 | 306 | // Public methods 307 | public void Add(string key, string value) 308 | { 309 | if (outputDict.ContainsKey(key)) 310 | { 311 | outputDict[key] = value; 312 | } 313 | else 314 | { 315 | outputDict.Add(key, value); 316 | } 317 | UpdateFpsText(); 318 | } 319 | 320 | public void Remove(string key) 321 | { 322 | outputDict.Remove(key); 323 | UpdateFpsText(); 324 | } 325 | 326 | public void Clear() 327 | { 328 | outputDict.Clear(); 329 | UpdateFpsText(); 330 | } 331 | 332 | public void LocateGUI() 333 | { 334 | _needsUpdate = true; 335 | } 336 | 337 | public void Toast(string message, float timeMs = 2000f) // Default is 2 seconds 338 | { 339 | _consoleText = message; 340 | toast_time = Mathf.Max(timeMs, 1000f); // Minimum 1 second 341 | 342 | if (!_isInitialized) 343 | { 344 | Debug.LogError("Toast: FpsMonitor is not initialized. Make sure FpsMonitor is properly set up in the scene."); 345 | return; 346 | } 347 | 348 | UpdateConsoleText(); 349 | } 350 | } 351 | } 352 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/FpsMonitor/FpsMonitor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b59ee393a0e7eba45b717071b992c08c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/FpsMonitor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24d680036e75c4c4983b6d71025ec557 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/FpsMonitor/Resources/FpsMonitorCanvas_103.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2460af67bd8e8ce40ad0a02f09d225aa 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/InputModuleSwitcher.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | #if ENABLE_INPUT_SYSTEM 4 | using UnityEngine.InputSystem.UI; 5 | #endif 6 | 7 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 8 | { 9 | /// 10 | /// Input Module Switcher that automatically configures the appropriate Input Module based on the input system being used. 11 | /// 12 | [RequireComponent(typeof(EventSystem))] 13 | public class InputModuleSwitcher : MonoBehaviour 14 | { 15 | private void Awake() 16 | { 17 | SetupInputSystem(); 18 | } 19 | 20 | private void SetupInputSystem() 21 | { 22 | var eventSystem = GetComponent(); 23 | if (eventSystem == null) 24 | return; 25 | 26 | #if ENABLE_INPUT_SYSTEM 27 | // Remove old Input Module if it exists 28 | var oldInput = eventSystem.GetComponent(); 29 | if (oldInput != null) 30 | { 31 | Destroy(oldInput); 32 | } 33 | 34 | // Add new Input Module if it doesn't exist 35 | if (eventSystem.GetComponent() == null) 36 | { 37 | eventSystem.gameObject.AddComponent(); 38 | } 39 | #endif 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/InputModuleSwitcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2324a6ec5cea95c4fbd55fb07e1f702b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/TouchController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | #if ENABLE_INPUT_SYSTEM 4 | using UnityEngine.InputSystem; 5 | using UnityEngine.InputSystem.EnhancedTouch; 6 | #endif 7 | 8 | namespace DlibFaceLandmarkDetectorWithOpenCVExample 9 | 10 | { 11 | public class TouchController : MonoBehaviour 12 | { 13 | public GameObject Cube; 14 | public float Speed = 0.1f; 15 | 16 | #if ENABLE_INPUT_SYSTEM 17 | private void OnEnable() 18 | { 19 | EnhancedTouchSupport.Enable(); 20 | } 21 | 22 | private void OnDisable() 23 | { 24 | EnhancedTouchSupport.Disable(); 25 | } 26 | #endif 27 | 28 | void Update() 29 | { 30 | #if ENABLE_INPUT_SYSTEM 31 | // New Input System 32 | #if ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR) 33 | // Touch input for mobile platforms 34 | if (UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count == 1) 35 | { 36 | var touch = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches[0]; 37 | 38 | // Ignore touch on UI elements 39 | if (EventSystem.current != null && EventSystem.current.IsPointerOverGameObject(touch.finger.index)) 40 | return; 41 | 42 | switch (touch.phase) 43 | { 44 | case UnityEngine.InputSystem.TouchPhase.Moved: 45 | float xAngle = touch.delta.y * Speed; 46 | float yAngle = -touch.delta.x * Speed; 47 | float zAngle = 0f; 48 | 49 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 50 | break; 51 | } 52 | } 53 | #else 54 | // Mouse input for non-mobile platforms 55 | var mouse = Mouse.current; 56 | if (mouse != null && mouse.leftButton.isPressed) 57 | { 58 | if (EventSystem.current.IsPointerOverGameObject()) 59 | return; 60 | 61 | var delta = mouse.delta.ReadValue(); 62 | float xAngle = delta.y * Speed; 63 | float yAngle = -delta.x * Speed; 64 | float zAngle = 0; 65 | 66 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 67 | } 68 | #endif 69 | #else 70 | // Old Input System 71 | #if ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR) 72 | // Touch input for mobile platforms 73 | int touchCount = Input.touchCount; 74 | 75 | if (touchCount == 1) 76 | { 77 | Touch t = Input.GetTouch(0); 78 | if (EventSystem.current.IsPointerOverGameObject(t.fingerId)) 79 | return; 80 | 81 | switch (t.phase) 82 | { 83 | case TouchPhase.Moved: 84 | float xAngle = t.deltaPosition.y * Speed; 85 | float yAngle = -t.deltaPosition.x * Speed; 86 | float zAngle = 0; 87 | 88 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 89 | break; 90 | } 91 | } 92 | #else 93 | // Mouse input for non-mobile platforms 94 | if (Input.GetMouseButton(0)) 95 | { 96 | if (EventSystem.current.IsPointerOverGameObject()) 97 | return; 98 | 99 | float xAngle = Input.GetAxis("Mouse Y") * Speed * 80; 100 | float yAngle = -Input.GetAxis("Mouse X") * Speed * 80; 101 | float zAngle = 0; 102 | 103 | Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World); 104 | } 105 | #endif 106 | #endif 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/DlibFaceLandmarkDetectorWithOpenCVExample/Utils/TouchController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd2d2dd7d089312499ff37863113aced 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Dlib FaceLandmark Detector 2 | ==================== 3 | 4 | Overview 5 | ----- 6 | Dlib FaceLandmark Detector is required to run example code of this repository. 7 | [https://assetstore.unity.com/packages/tools/integration/dlib-facelandmark-detector-64314](https://assetstore.unity.com/packages/tools/integration/dlib-facelandmark-detector-64314?aid=1011l4ehR) 8 | 9 | Setup Tutorial & Demo Video 10 | ----- 11 | [![](http://img.youtube.com/vi/xUw3LillWrs/0.jpg)](https://www.youtube.com/watch?v=xUw3LillWrs) 12 | [![](http://img.youtube.com/vi/pwm66AC7lFk/0.jpg)](https://www.youtube.com/watch?v=pwm66AC7lFk) 13 | 14 | Demo 15 | ----- 16 | - WebGL 17 | - WebGL (simd) 18 | - WebGL (simd, threads) 19 | - Android 20 | 21 | 22 | Manual 23 | ----- 24 | [ReadMe.pdf](/Assets/DlibFaceLandmarkDetector/ReadMe.pdf) 25 | 26 | API Reference 27 | ----- 28 | 29 | 30 | Official Site 31 | ----- 32 | 33 | --------------------------------------------------------------------------------