I have a Numaker-PFM-M487 device and it contains the Bin file. The Bin file contains the weights and labels as ‘cat, dog, etc’ of a Neural network.
Now, how to print one label in the Bin file by this processing.
I made it like this code but it only shows the number, not the label.
Please help me, Many thanks.
Here is my code;
Serial myPort;
int SIZE = 3072;
PImage img;
void setup(){
size(32, 32);
img = loadImage("image3.png");
image(img, 0, 0);
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[1], 9600);
}
void draw() {
image(img, 0, 0);
}
void keyPressed(){
int i = 0, new_b = 0, index=0;
String all = "";
int temp;
PImage myImage = img ;
myImage.loadPixels();
for(i=0;i<3072;i++){
float b = blue(myImage.pixels);
new_b = (int)b;
all = all + new_b + ",";
}
myPort.write(all); //send String type data to board
println(all);
delay(1000);
while((temp = myPort.read()) > 0){
if(index % 32 == 0){
println();
index = 0;
}
print((char)temp);//recieve labels from M487 board
print(" ");
index++;
}
}