Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.51 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.51 KB

LeNet Example

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.

Usage

> 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.

Example Output

> 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.