From 4a8d6592abe0873d23dfc0dbd43701a2bc7f4ef1 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Thu, 28 Jul 2022 19:43:45 +0200 Subject: [PATCH] CNNThreshold removed for Analog100 and Digital100 --- .../ClassFlowCNNGeneral.cpp | 21 ++++--------------- .../test_cnnflowcontroll.cpp | 9 ++++++++ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp index 7c67db53..2e25b02f 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp @@ -811,34 +811,21 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time) case Analogue100: { int _num; - float _fit; float _result_save_file; tflite->LoadInputImageBasis(GENERAL[_ana]->ROI[i]->image); tflite->Invoke(); _num = tflite->GetOutClassification(); - _fit = tflite->GetOutputValue(_num); - + GENERAL[_ana]->ROI[i]->result_float = (float)_num / 10.0; _result_save_file = GENERAL[_ana]->ROI[i]->result_float; - if (_fit < CNNGoodThreshold) - { - GENERAL[_ana]->ROI[i]->isReject = true; - GENERAL[_ana]->ROI[i]->result_float = -1; - _result_save_file+= 100; // Für den Fall, dass fit nicht ausreichend, soll trotzdem das Ergebnis mit "-10x.y" abgespeichert werden. - string zw = "Value Rejected due to Threshold (Fit: " + to_string(_fit) + "Threshold: " + to_string(CNNGoodThreshold); - printf("Value Rejected due to Threshold (Fit: %f, Threshold: %f\n", _fit, CNNGoodThreshold); - LogFile.WriteToFile(zw); - } - else - { - GENERAL[_ana]->ROI[i]->isReject = false; - } - + + GENERAL[_ana]->ROI[i]->isReject = false; + printf("Result General(Analog)%i: %f\n", i, GENERAL[_ana]->ROI[i]->result_float); if (isLogImage) diff --git a/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp b/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp index 18129ada..89725fb4 100644 --- a/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp +++ b/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp @@ -88,5 +88,14 @@ void test_ZeigerEvalHybrid() { // the 4.4 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5) TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybrid(4.5, 9.5, 9)); + // 59.96889 - Pre: 58.94888 + // 8.6 : 9.8 : 6.7 + // the 4.4 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5) + TEST_ASSERT_EQUAL(8, undertest.ZeigerEvalHybrid(8.6, 9.8, 9)); + + // issue #879 vorgaenger is -1, zahl = 6.7 + //TEST_ASSERT_EQUAL(7, undertest.ZeigerEvalHybrid(6.7, -1.0, -1)); + + }