public void convertLabelToScenario(object sender, DataProcessorEventArgs eventArgs) { var label = eventArgs.predictionData; var labelLow = eventArgs.predictionData.ToLower(); if (labelLow.Contains("tophead")) { convertTopHeadLabel(label); } else if (labelLow.Contains("leftsidehead")) { convertLeftSideHeadLabel(label); } else if (labelLow.Contains("rightsidehead")) { convertRightSideHeadLabel(label); } else if (labelLow.Contains("righthand")) { convertRightHandLabel(label); } else if (labelLow.Contains("lefthand")) { convertLeftHandLabel(label); } else if (labelLow.Contains("front")) { convertFrontLabel(label); } }
private void sensorDataProcessor(SignalClassifierController classifier, int sensorQty, ref IEnumerable <IEnumerable <short> > readings, string robotBodyPart) { var frame = readings; var processingResult = predictSingleFrame(frame, classifier, sensorQty); Console.WriteLine(processingResult); var eventArgs = new DataProcessorEventArgs(); if (processingResult.classPercentages.All(cp => cp < 0.6) && !processingResult.prediction.Contains("Strike")) { switch (robotBodyPart) { case "topHead": eventArgs.predictionData = "OtherLowTopHead"; break; case "leftSideHead": eventArgs.predictionData = "OtherLowLeftSideHead"; break; case "rightSideHead": eventArgs.predictionData = "OtherLowRightSideHead"; break; case "rightHand": eventArgs.predictionData = "OtherLowRightHand"; break; case "leftHand": eventArgs.predictionData = "OtherLowLeftHand"; break; case "front": eventArgs.predictionData = "OtherLowFront"; break; default: eventArgs.predictionData = "OtherLowLeftSideHead"; break; } } else { eventArgs.predictionData = processingResult.prediction; } sensorDataProcessed.Invoke(this, eventArgs); eventArgs = null; readings = Enumerable.Repeat(Enumerable.Repeat <short>(0, sensorQty), 100); }