mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
Rolling 20211002
This commit is contained in:
@@ -61,6 +61,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
prev = ZeigerEval(GENERAL[_analog]->ROI[i]->result_float, prev);
|
||||
result = std::to_string(prev) + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (CNNType == Digital)
|
||||
@@ -72,6 +73,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
else
|
||||
result = result + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (CNNType == DigitalHyprid)
|
||||
@@ -116,6 +118,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
result = "N" + result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -540,7 +543,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
||||
if (debugdetailgeneral) LogFile.WriteToFile("Nach Invoke");
|
||||
|
||||
_num = tflite->GetOutClassification(0, 10);
|
||||
_nachkomma = tflite->GetOutClassification(11, 22);
|
||||
_nachkomma = tflite->GetOutClassification(11, 21);
|
||||
|
||||
|
||||
string _zwres = "Nach Invoke - Nummer: " + to_string(_num) + " Nachkomma: " + to_string(_nachkomma);
|
||||
|
||||
@@ -89,7 +89,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
|
||||
if (NUMBERS[j]->name == name)
|
||||
{
|
||||
NUMBERS[j]->PreValue = stof(zwvalue.c_str());
|
||||
NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma + 1); // SIcherheitshalber 1 Stelle mehr, da ggf. Exgtended Resolution an ist (wird erst beim ersten Durchlauf gesetzt)
|
||||
|
||||
time_t tStart;
|
||||
int yy, month, dd, hh, mm, ss;
|
||||
@@ -123,7 +123,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
|
||||
|
||||
if (NUMBERS[j]->digit_roi || NUMBERS[j]->analog_roi)
|
||||
{
|
||||
NUMBERS[j]->ReturnValue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma);
|
||||
NUMBERS[j]->ReturnValue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma + 1); // SIcherheitshalber 1 Stelle mehr, da ggf. Exgtended Resolution an ist (wird erst beim ersten Durchlauf gesetzt)
|
||||
NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue;
|
||||
}
|
||||
}
|
||||
@@ -595,13 +595,14 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
|
||||
if (NUMBERS[j]->digit_roi)
|
||||
{
|
||||
if (NUMBERS[j]->analog_roi)
|
||||
if (NUMBERS[j]->analog_roi)
|
||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, false);
|
||||
else
|
||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, NUMBERS[j]->isExtendedResolution); // Extended Resolution nur falls es keine analogen Ziffern gibt
|
||||
}
|
||||
if (NUMBERS[j]->digit_roi && NUMBERS[j]->analog_roi)
|
||||
NUMBERS[j]->ReturnRawValue = NUMBERS[j]->ReturnRawValue + ".";
|
||||
|
||||
if (NUMBERS[j]->analog_roi)
|
||||
NUMBERS[j]->ReturnRawValue = NUMBERS[j]->ReturnRawValue + flowAnalog->getReadout(j, NUMBERS[j]->isExtendedResolution);
|
||||
|
||||
@@ -822,14 +823,14 @@ float ClassFlowPostProcessing::checkDigitConsistency(float input, int _decilamsh
|
||||
while (pot <= pot_max)
|
||||
{
|
||||
zw = input / pow(10, pot-1);
|
||||
aktdigit_before = ((int) zw) % 10;
|
||||
aktdigit_before = ((int) zw + 10) % 10;
|
||||
zw = _preValue / pow(10, pot-1);
|
||||
olddigit_before = ((int) zw) % 10;
|
||||
olddigit_before = ((int) zw + 10) % 10;
|
||||
|
||||
zw = input / pow(10, pot);
|
||||
aktdigit = ((int) zw) % 10;
|
||||
aktdigit = ((int) zw + 10) % 10;
|
||||
zw = _preValue / pow(10, pot);
|
||||
olddigit = ((int) zw) % 10;
|
||||
olddigit = ((int) zw + 10) % 10;
|
||||
|
||||
no_nulldurchgang = (olddigit_before <= aktdigit_before);
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ int CTfLiteClass::GetOutClassification(int _von, int _bis)
|
||||
//printf("\n number output neurons: %d\n\n", numeroutput);
|
||||
|
||||
if (_bis == -1)
|
||||
_bis = numeroutput;
|
||||
_bis = numeroutput -1;
|
||||
|
||||
if (_von == -1)
|
||||
_von = 0;
|
||||
|
||||
if (_bis > numeroutput)
|
||||
if (_bis >= numeroutput)
|
||||
{
|
||||
printf("ANZAHL OUTPUT NEURONS passt nicht zu geforderter Classifizierung!");
|
||||
return -1;
|
||||
@@ -57,7 +57,7 @@ int CTfLiteClass::GetOutClassification(int _von, int _bis)
|
||||
|
||||
zw_max = output2->data.f[_von];
|
||||
zw_class = _von;
|
||||
for (int i = _von+1; i <= _bis; ++i)
|
||||
for (int i = _von + 1; i <= _bis; ++i)
|
||||
{
|
||||
zw = output2->data.f[i];
|
||||
if (zw > zw_max)
|
||||
|
||||
Reference in New Issue
Block a user