mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
Add analog classification (100) as modeltype analog100
This commit is contained in:
@@ -36,7 +36,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
|||||||
return result;
|
return result;
|
||||||
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::getReadout _analog=" + std::to_string(_analog) + ", _extendedResolution=" + std::to_string(_extendedResolution) + ", prev=" + std::to_string(prev));
|
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::getReadout _analog=" + std::to_string(_analog) + ", _extendedResolution=" + std::to_string(_extendedResolution) + ", prev=" + std::to_string(prev));
|
||||||
|
|
||||||
if (CNNType == Analogue)
|
if (CNNType == Analogue || CNNType == Analogue100)
|
||||||
{
|
{
|
||||||
float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float;
|
float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float;
|
||||||
int ergebnis_nachkomma = ((int) floor(zahl * 10) + 10) % 10;
|
int ergebnis_nachkomma = ((int) floor(zahl * 10) + 10) % 10;
|
||||||
@@ -490,7 +490,7 @@ bool ClassFlowCNNGeneral::doAlignAndCut(string time)
|
|||||||
|
|
||||||
void ClassFlowCNNGeneral::DrawROI(CImageBasis *_zw)
|
void ClassFlowCNNGeneral::DrawROI(CImageBasis *_zw)
|
||||||
{
|
{
|
||||||
if (CNNType == Analogue)
|
if (CNNType == Analogue || CNNType == Analogue100)
|
||||||
{
|
{
|
||||||
int r = 0;
|
int r = 0;
|
||||||
int g = 255;
|
int g = 255;
|
||||||
@@ -561,8 +561,13 @@ bool ClassFlowCNNGeneral::getNetworkParameter()
|
|||||||
// printf("TFlite-Type set to DigitalHyprid\n");
|
// printf("TFlite-Type set to DigitalHyprid\n");
|
||||||
// break;
|
// break;
|
||||||
case 100:
|
case 100:
|
||||||
|
if (modelxsize==32 && modelysize == 32) {
|
||||||
|
CNNType = Analogue100;
|
||||||
|
printf("TFlite-Type set to Analogue100\n");
|
||||||
|
} else {
|
||||||
CNNType = Digital100;
|
CNNType = Digital100;
|
||||||
printf("TFlite-Type set to Digital\n");
|
printf("TFlite-Type set to Digital\n");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("ERROR ERROR ERROR - tflite passt nicht zur Firmware - ERROR ERROR ERROR\n");
|
printf("ERROR ERROR ERROR - tflite passt nicht zur Firmware - ERROR ERROR ERROR\n");
|
||||||
@@ -617,6 +622,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
|||||||
if (isLogImage)
|
if (isLogImage)
|
||||||
LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result_float, NULL, time, GENERAL[_ana]->ROI[i]->image_org);
|
LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result_float, NULL, time, GENERAL[_ana]->ROI[i]->image_org);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case Digital:
|
case Digital:
|
||||||
{
|
{
|
||||||
GENERAL[_ana]->ROI[i]->result_klasse = 0;
|
GENERAL[_ana]->ROI[i]->result_klasse = 0;
|
||||||
@@ -793,6 +799,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Digital100:
|
case Digital100:
|
||||||
|
case Analogue100:
|
||||||
{
|
{
|
||||||
int _num;
|
int _num;
|
||||||
float _fit;
|
float _fit;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
enum t_CNNType {
|
enum t_CNNType {
|
||||||
AutoDetect,
|
AutoDetect,
|
||||||
Analogue,
|
Analogue,
|
||||||
|
Analogue100,
|
||||||
Digital,
|
Digital,
|
||||||
// DigitalHyprid,
|
// DigitalHyprid,
|
||||||
DigitalHyprid10,
|
DigitalHyprid10,
|
||||||
|
|||||||
Reference in New Issue
Block a user