Esempio 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;
    }
Esempio 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;
    }
Esempio 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);
    }