Skip to content

This repository is used to share code with project members for our final project in CSCI-B351

Notifications You must be signed in to change notification settings

rpw1/351-Final-Project

Repository files navigation

K-NN Number and Symbol Recognition CSCI-B351 Final Project

By Ryan Williams and Carson Crick

Setup

This repository uses a third party software called python-mnist.

The third party software can be installed by using the command:

$ pip install python-mnist

The PyPi page can by found here and the Github page for python-mnist is here

If there are issues with installing python-minst, we created a virtual environment to run the project using pipenv. A guide to setup pipenv can be found here Just go to the path of the repository using terminal or git and run:

$ pip install --user pipenv
$ cd 351-Final-Project
$ pipenv install
$ pipenv run python src/python_file

Data

In this project, we use the MNIST database for our number testing and training data.

The training and testing data for our symbols:

  • Multiplication (*)
  • Division (*)
  • Addition (+)
  • Subtraction (-)

Each picture has a 28 x 28 grid filled with gray scale values from 0-255. The python-mist package has a display function that prints out the grid with @ and dots. The display function counts any gray scale value equal to or under 200 as noise. Here is an example of testing/training data. This is a 9 from the MNIST database using the display function.

............................
............................
............................
.............@@@............
...........@@@@@@...........
.........@@@....@...........
.........@@........@@.......
........@@........@@........
........@.........@@........
........@.........@@........
.......@@........@@@........
.......@@........@@.........
.......@@.......@@@.........
........@@....@@@@@.........
.........@@@@@..@@..........
................@@..........
................@@..........
................@@..........
...............@@...........
...............@@...........
...............@@...........
...............@............
..............@@............
............................
............................

Using The Calculator

  • Enter one symbol/number at a time
  • Only enter positive single digit numbers at a time (0-9)
  • Acceptable symbols are for addition, subtraction, multiplication and division (+, -, *, /)
  • To create a multiple digit number then enter numbers back to back
  • Input 's' to have the program solve the inputted function
  • Input 'r' to reset the equation
  • Input 'd' to see a simple demo of the program
  • Input 'e' to solve a random equation
  • Input 'p' to print out your current list of arguments
  • Input 'u' to remove the last item added to the arguments
  • Input 'q' to quit the program
  • Input 'c' to clear the terminal and list options again

To test out the calculator, go to the relative path of the project and type

$ py src/userInput.py

or

$ pipenv run python src/userInput.py

About

This repository is used to share code with project members for our final project in CSCI-B351

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages