示例#1
0
    public void OnLoadClicked()
    {
        // Clear buttons
        ClearGestureButtons();

        using (BinaryReader reader = new BinaryReader(File.Open("data/Generator.gg", FileMode.Open)))
        {
            mGenerator = new GestureNeuralNetworkGenerator(reader);
        }

        // Load in gestures
        List <string> gestureNames = mGenerator.GetGestureNames();

        // Create buttons for the gestures
        foreach (string name in gestureNames)
        {
            AddGestureButton(name);
        }

        if (gestureNames.Count > 0)
        {
            SetTrainingGesture(gestureNames[gestureNames.Count - 1]);
        }

        // Set current Generator threshold
        mThresholdSlider.value = mGenerator.MinThreshold;

        SetStatusText("LOAD Success");
    }
示例#2
0
    public void OnGenerateClicked()
    {
        mDetector = new GestureDetector(mGenerator.Generate(), mGenerator.GetGestureNames());
        mDetector.MinThreshold     = mGenerator.MinThreshold;
        mDetector.GestureDetected += OnGestureDetected;

        UnityGestureIO.SaveDetector("data/Detector.gd", mDetector);

        OnToggleTrainingClicked();
    }