Add WebGL platform Supports!

A new target platform has been added to our Unity Asset “OpenCVForUnity” and “DlibFaceLandmarkDetector“. With this update, it is now possible to develop WebGL applications that users can easily play with web browsers. Although it is currently in beta version, it seems that the main functions are working without problems. It works with Unity 5.3 or later. Demo Application Click To Start Development Tips Put a file that you want to use for the Utils.getFilePathAsync() in the “Aseets/StreamingAssets/” folder. In Case of WebGL platform, you need to use the Utils.getFilePathAsync() instead of the Utils.getFilePath(). (The haarcascade_frontalface_alt.xml is for OpenCVForUnityExample’s scenes. Please copy only when necessary) On the WebGL platform (asm.js), the calculation result of Float type may be significantly different from other platforms. When using the OpenCV’s method that use the Mat class (CvType is CV_32F) as an argument, you need to pay attention to the calculation precision. Please try experiencing WebGL development.

How to extract the shape predictor from “mmod_dog_hipsterizer.dat”

First of all, please look at this article. Hipsterize Your Dog With Deep Learning (dlib.net)The “mmod_dog_hipsterizer.dat” cannot be used as a shape predictor data because it is distributed in a state in which combines multiple files. I will introduce here because I wrote the code for the use of the dog face shape predictor data in “DlibFaceLandmarkDetector”.This example scene was created based on the “DlibFaceLandmarkDetector/Examples/CatDetectionExample”.Replace the “CatDetectionExample.cs” that is attached to Quad to this script code.Set to the dog image to the texture2D inspector.The file that you downloaded and unzipped from here must be put to the “streamingAssets” folder.using UnityEngine; using System.Collections; using System.Collections.Generic; using System.IO; #if UNITY_5_3 || UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; #endif using DlibFaceLandmarkDetector; namespace DlibFaceLandmarkDetectorSample { /// <summary> /// Dog detection example. /// </summary> public class DogDetectionExample : MonoBehaviour { /// <summary> /// The texture2 d. /// </summary> public Texture2D texture2D; //https://github.com/davisking/dlib/raw/master/examples/faces/dogs.jpg private Texture2D m_tex; private int m_width, m_height; private Color[] m_linesColor = null; // Use this for initialization void Start () { gameObject.transform.localScale = new Vector3 (texture2D.width, texture2D.height, 1); Debug.Log (“Screen.width ” + Screen.width + ” Screen.height ” + Screen.height + ” Screen.orientation ” + Screen.orientation); float width = gameObject.transform.localScale.x; float height = gameObject.transform.localScale.y; float widthScale = (float)Screen.width / width; float heightScale = (float)Screen.height / height; if (widthScale < heightScale) { Camera.main.orthographicSize = (width * (float)Screen.height / (float)Screen.width) / […]