Skip to content

Commit

Permalink
Merge pull request #29 from tajmorton/add_reqs
Browse files Browse the repository at this point in the history
Add instructions for installing ocropy into a virtualenv
  • Loading branch information
tmbdev committed Mar 16, 2015
2 parents 409cd9d + 27a12ae commit 6beba0e
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 16 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@ ocropy

Python-based OCR package using recurrent neural networks.

To install, use:
To install OCRopus dependencies system-wide:

$ sudo apt-get install $(cat PACKAGES)
$ wget -nd http://www.tmbdev.net/en-default.pyrnn.gz
$ mv en-default.pyrnn.gz models/
$ sudo python setup.py install

Alternatively, dependenices can be installed into a [Python Virtual Environment]
(http://docs.python-guide.org/en/latest/dev/virtualenvs/):

$ virtualenv ocropus_venv/
$ source ocropus_venv/bin/source
$ pip install -r requirements_1.txt
# tables has some dependencies which must be installed first:
$ pip install -r requirements_2.txt
$ wget -nd http://www.tmbdev.net/en-default.pyrnn.gz
$ mv en-default.pyrnn.gz models/

To test the recognizer, run:

$ ./run-test
Expand Down
2 changes: 1 addition & 1 deletion ocropus-dewarp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import random as pyrandom
import re
Expand Down
2 changes: 1 addition & 1 deletion ocropus-econf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import warnings,numpy,argparse,sys,os,os.path,multiprocessing,codecs
Expand Down
2 changes: 1 addition & 1 deletion ocropus-errs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import argparse,sys,os,os.path,multiprocessing
Expand Down
2 changes: 1 addition & 1 deletion ocropus-gpageseg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

# TODO:
# ! add option for padding
Expand Down
2 changes: 1 addition & 1 deletion ocropus-gtedit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

from pylab import *
import argparse,codecs,re,os.path,ocrolib,base64
Expand Down
2 changes: 1 addition & 1 deletion ocropus-hocr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import __builtin__ as python
import random as pyrandom
Expand Down
2 changes: 1 addition & 1 deletion ocropus-linegen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# vim: set fileencoding=utf8 :

import random as pyrandom
Expand Down
2 changes: 1 addition & 1 deletion ocropus-lpred
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import random as pyrandom
import re
Expand Down
2 changes: 1 addition & 1 deletion ocropus-ltrain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import random as pyrandom
import re
Expand Down
2 changes: 1 addition & 1 deletion ocropus-nlbin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

from pylab import *
from numpy.ctypeslib import ndpointer
Expand Down
2 changes: 1 addition & 1 deletion ocropus-rpred
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import traceback
import codecs
Expand Down
4 changes: 1 addition & 3 deletions ocropus-rtrain
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/python

#import sys;sys.path.append('/home/tmb/github/ocropy/clstm')
#!/usr/bin/env python

import random as pyrandom
import re
Expand Down
2 changes: 1 addition & 1 deletion ocropus-visualize-results
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import glob
import matplotlib
Expand Down
7 changes: 7 additions & 0 deletions requirements_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy>=1.9.2
scipy>=0.15.1
matplotlib>=1.4.3
beautifulsoup4>=4.3.2
numexpr>=2.4
Cython>=0.22
Pillow>=2.7.0
1 change: 1 addition & 0 deletions requirements_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tables>=3.1.1

0 comments on commit 6beba0e

Please sign in to comment.