-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
59 lines (35 loc) · 1.72 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
###################
## README ##
###################
Files:
data.py # Gets training and testing data and formats it
image.py # Processes an image, and does character segmentation
KNN.py # Implementation of KNN
LshKNN.py # Implementation of KNN with LSH
OCR.py # Runs OCR on and image and returns string
testing.py # Used for testing on the MNIST testing set
## To run files, the following packages are needed: (TODO makefile) ###############
OpenCV: $ brew tap homebrew/science
$ brew install opencv
(may need to add to python path as well)
More Info: Without brew - http://opencv.org/
numPy: $ pip install numpy
idx2numpy: $ pip install idx2numpy
More Info: https://github.com/ivanyu/idx2numpy
LSHash: $ pip install lshash
More Info: https://github.com/kayzh/LSHash
## Testing ########################################################################
## To run KNN on MNIST test set (Max trainingSize = 60000, Max testingSize = 10000)
$ python testing.py -k 3 --trainingSize 30000 --testingSize 500 --lsh 0
NOTE: each classification takes about 1400 miliseconds, so any large testSize will
take considerable time.
## To run KNN with LSH on MNIST test set
$ python testing.py -k 3 --trainingSize 30000 --testingSize 500 --lsh 1
NOTE: Building hash tables to run KNN with LSH takes considerable time, in most
intances this would built once and then persisted.
## To Run OCR on an Image #########################################################
1) Place image in 'images' folder
2) $ python OCR.py -i IMAGENAME.JPG -l 0
There exists example images to run it already
$ python OCR.py -i 1.JPG -l 0
###################################################################################