private void ShowTrainModelButton() { // Only run button logic when rapidlib reference not null and training examples are not null if (m_IMLConfigNode.Model != null && m_IMLConfigNode.TotalNumTrainingData > 0) { string nameButton = ""; if (m_IMLConfigNode.Training) { nameButton = "STOP Training Model"; } else { nameButton = "Train Model"; } // Disable button if model is Running OR Trainig if (m_IMLConfigNode.Running || m_IMLConfigNode.Training) { GUI.enabled = false; } if (GUILayout.Button(nameButton)) { m_IMLConfigNode.TrainModel(); } // Always enable it back at the end GUI.enabled = true; } // If rapidlib reference is null we draw a disabled button else { GUI.enabled = false; if (m_IMLConfigNode.TotalNumTrainingData == 0) { EditorGUILayout.HelpBox("There are no training examples", MessageType.Error); } if (GUILayout.Button("Train Model")) { //m_TrainingExamplesNode.ToggleCollectExamples(); } //GUI.enabled = true; } }
private void ShowTrainModelButton() { // Only run button logic when rapidlib reference not null if (m_IMLConfigNode.Model != null) { string nameButton = ""; if (m_IMLConfigNode.Training) { nameButton = "STOP Training Model"; } else { nameButton = "Train Model"; } // Disable button if model is Running OR Trainig if (m_IMLConfigNode.Running || m_IMLConfigNode.Training) { GUI.enabled = false; } if (GUILayout.Button(nameButton)) { m_IMLConfigNode.TrainModel(); } // Always enable it back at the end GUI.enabled = true; } // If rapidlib reference is null we draw a disabled button else { GUI.enabled = false; if (GUILayout.Button("Train Model")) { //m_TrainingExamplesNode.ToggleCollectExamples(); } GUI.enabled = true; } }