intel / inference-engine-node

Bringing the hardware accelerated deep learning inference to Node.js and Electron.js apps.
Apache License 2.0
33 stars 8 forks source link

Verify the Preprocesschannel at the example hello_classification_node #44

Closed lionkunonly closed 3 years ago

lionkunonly commented 3 years ago

I added using PreProcessingChannel API to the hello_classification_node in this PR. And the result shows that the Preprocesschannel works well. Please check the file example/hello_classification_node/main.js. OpenVINO version is 2021.1

With the command: node main.js -m ../../models/squeezenet1.1/FP16/squeezenet1.1.xml -i test.png -d CPU -n 10, the result is:

id of classprobability    label
-------   -------        -------
387       0.998859       lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
294       0.000253       brown bear, bruin, Ursus arctos
277       0.000243       red fox, Vulpes vulpes
278       0.000180       kit fox, Vulpes macrotis
298       0.000084       mongoose

With the command: node main.js -m ../../models/squeezenet1.1/FP16/squeezenet1.1.xml -i test.png --mean [10,10,10] --std [10,20,40] -d CPU -n 10, the result is:

id of classprobability    label
-------   -------        -------
5         0.230962       electric ray, crampfish, numbfish, torpedo
850       0.061423       teddy, teddy bear
904       0.035352       window screen
6         0.030383       stingray
78        0.026189       tick
artyomtugaryov commented 3 years ago

But you did not remove process the image using mean and std in the 268 line :

input_data[i + rgb.r] =         
              (image.bitmap.data[idx + 0] - mean[0]) / std[0];  // R
artyomtugaryov commented 3 years ago

I think we can close this PR

huningxin commented 3 years ago

@lionkunonly , any comments? Could we close this PR?

huningxin commented 3 years ago

I think we can close this PR.