This example showcases the LeNet-based handwritten digits classification by WebNN API.
This example leverages the network topology of the LeNet example of Caffe*, the weights lenet.bin
and MnistUByte
reader of the LeNet example of OpenVINO*. This example uses one-channel UByte picture as an input. The sample UByte pictures (*.idx
) are extracted from the MNIST dataset.
> out/Release/LeNet -h
LeNet [OPTIONs]
Options:
-h Print this message.
-i "<path>" Required. Path to an image.
-m "<path>" Required. Path to a .bin file with trained weights/biases.
-n "<integer>" Optional. Number of iterations. The default value is 1, and should not be less than 1.
> out/Release/LeNet -m node/third_party/webnn-polyfill/test-data/models/lenet_nchw/weights/lenet.bin -i examples/images/idx/9.idx
Info: Compilation Time: 27.3588 ms
Info: Execution Time: 0.919068 ms
Prediction Result:
# Probability Label
0 100.00% 9
1 0.00% 2
2 0.00% 0
Info: Done.
You can also try other example images.