Пример #1
0
    public static void trainingUpdateCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle     obj = (GCHandle)ptr;
        Sample_Phone me  = (obj.Target as Sample_Phone);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
    }
Пример #2
0
    public static void trainingFinishCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle     obj = (GCHandle)ptr;
        Sample_Phone me  = (obj.Target as Sample_Phone);

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

        // 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 save_file_path = "Assets/GestureRecognition";
#elif UNITY_ANDROID
        string save_file_path = Application.persistentDataPath;
#else
        string save_file_path = Application.streamingAssetsPath;
#endif
        me.gr.saveToFile(save_file_path + "/gestures.dat");
    }