Ejemplo n.º 1
0
    public static void trainingUpdateCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_OneHanded me  = (obj.Target as Sample_OneHanded);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
    }
Ejemplo n.º 2
0
    public static void trainingFinishCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_OneHanded me  = (obj.Target as Sample_OneHanded);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
        // Signal that training was finished.
        me.recording_gesture = -3;
    }
Ejemplo n.º 3
0
    public static void trainingFinishCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_OneHanded me  = (obj.Target as Sample_OneHanded);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
        // Signal that training was finished.
        me.recording_gesture = -3;
        // Save the data to file.
#if UNITY_EDITOR
        string GesturesFilePath = "Assets/GestureRecognition";
#elif UNITY_ANDROID
        string GesturesFilePath = Application.persistentDataPath;
#else
        string GesturesFilePath = Application.streamingAssetsPath;
#endif
        if (me.SaveGesturesFile == null)
        {
            me.SaveGesturesFile = "Sample_OneHanded_MyRecordedGestures.dat";
        }
        me.gr.saveToFile(GesturesFilePath + "/" + me.SaveGesturesFile);
    }