Our application is a character recognizer. There are two main python files with this application, trainingprogram.py and testingprogram.py. The trainingprogram.py is used to train a model and save the height and weights of the model to designated files. After this, the testingprogram.py uses these files to load a trained model for classification. Then the application asks for the user's input of the path to an image they would like to be classified. This image is then evaluated by the model and it outputs its prediction and confidence score.
In order to run this application you must download numpy, torchvision, torch, and tensorflow
- First run trainingprogram.py This will begin to train the model with the keras mnist character dataset
- After the this program has completed training it will prompt the user for the file to save the weights to(.pth format)
- Similarly it will ask the user to enter the file they would like to save the image height to. Then this program is complete.
- Next run testingprogram.py
- The user will be prompted to input the file path of the saved weights for the trained model, so enter the path that was used for saving the weights from the trainingprogram.py.
- Next the user will be prompted to input the file path of the saved height for the image input, so enter the path that was used for saving the height from the trainingprogram.py.
- The user will be prompted to input a file path for an image to be classified by the model.
- The program will then output the predicted digit, the confidence, and the time it took for the model to identify the image.
- Lastly, the user will be prompted to either identify another image by inputting 1, or input 0 to stop the application.