Open oveddan opened 5 years ago
Hi @oveddan , I was curious that when can we expect some examples of poses consumption in Unity?
Hi I am not too fammiliar with using Github but i have code that can help with communication to unity. So I will just share it here.
Unity has a built-in JSON utility which can parse JSON data. But before we can do that, we need to encapsulate all the data into their respective classes:
[System.Serializable] public class PosenetMessageData //this class holds all the data { public PoseData[] poses; public ImageData image; }
[System.Serializable] public class ImageData { public int width; public int height; }
[System.Serializable] public class PoseData { public float score; //confidence public KeypointsData[] keypoints; }
[System.Serializable] public class KeypointsData { public float score; //confidence public string part; //name of the part public PositionData position; }
[System.Serializable] public class PositionData { public float x; public float y; }
after doing this, simply call:
posenetMessageData = JsonUtility.FromJson
You can use websocket-sharp for websocket communication in unity.
Hi, thank you for the detailed info. is the resolution fine in unity?
Show some examples of how to consume poses in OpenFrameworks, Unity, and TouchDesigner.