MNIST_LeNet is a CNN model used for handwriting recognization.
This model is trained with traditional MNIST dataset, which is included in PyTorch as default.
As a result, it could achieve 99.5% accuracy among handwriting recognization tasks.
1import torch
2
3LeNet = torch.load('path/to/model/mnist_lenet.pt')
4
5LeNet.eval()
6
7# config preprocessor for your data
8transform = ...
9
10# load data
11input_data = transform(open('path/to/your/data'))
12
13# predict with our model
14with torch.no_grad():
15 output = LeNet(input_data)
16
17# explain results
18prob = torch.nn.functional.softmax(output[0], dim=0)
19...