diff --git a/README.md b/README.md index 0e2a2f2e..4ef7a7db 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/ocropus-dewarp b/ocropus-dewarp index 54d68260..0b5e6a63 100755 --- a/ocropus-dewarp +++ b/ocropus-dewarp @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import random as pyrandom import re diff --git a/ocropus-econf b/ocropus-econf index 7cd1d906..bedb84c1 100755 --- a/ocropus-econf +++ b/ocropus-econf @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings,numpy,argparse,sys,os,os.path,multiprocessing,codecs diff --git a/ocropus-errs b/ocropus-errs index a0934379..58146709 100755 --- a/ocropus-errs +++ b/ocropus-errs @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse,sys,os,os.path,multiprocessing diff --git a/ocropus-gpageseg b/ocropus-gpageseg index 9e996ff0..ce7e7d95 100755 --- a/ocropus-gpageseg +++ b/ocropus-gpageseg @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # TODO: # ! add option for padding diff --git a/ocropus-gtedit b/ocropus-gtedit index 5c67412d..b184ed8d 100755 --- a/ocropus-gtedit +++ b/ocropus-gtedit @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from pylab import * import argparse,codecs,re,os.path,ocrolib,base64 diff --git a/ocropus-hocr b/ocropus-hocr index 2f9497dc..c6b7428e 100755 --- a/ocropus-hocr +++ b/ocropus-hocr @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import __builtin__ as python import random as pyrandom diff --git a/ocropus-linegen b/ocropus-linegen index e6dce9e8..aaf89d64 100755 --- a/ocropus-linegen +++ b/ocropus-linegen @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # vim: set fileencoding=utf8 : import random as pyrandom diff --git a/ocropus-lpred b/ocropus-lpred index 27e29190..d037e606 100755 --- a/ocropus-lpred +++ b/ocropus-lpred @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import random as pyrandom import re diff --git a/ocropus-ltrain b/ocropus-ltrain index 38a33658..4eb74da4 100755 --- a/ocropus-ltrain +++ b/ocropus-ltrain @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import random as pyrandom import re diff --git a/ocropus-nlbin b/ocropus-nlbin index f9c0f82c..d3213629 100755 --- a/ocropus-nlbin +++ b/ocropus-nlbin @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from pylab import * from numpy.ctypeslib import ndpointer diff --git a/ocropus-rpred b/ocropus-rpred index e3c21bba..ac2c042e 100755 --- a/ocropus-rpred +++ b/ocropus-rpred @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import traceback import codecs diff --git a/ocropus-rtrain b/ocropus-rtrain index 87db9284..e7acc0c1 100755 --- a/ocropus-rtrain +++ b/ocropus-rtrain @@ -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 diff --git a/ocropus-visualize-results b/ocropus-visualize-results index d77ceb74..fc09ed06 100755 --- a/ocropus-visualize-results +++ b/ocropus-visualize-results @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import glob import matplotlib diff --git a/requirements_1.txt b/requirements_1.txt new file mode 100644 index 00000000..34102d9c --- /dev/null +++ b/requirements_1.txt @@ -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 diff --git a/requirements_2.txt b/requirements_2.txt new file mode 100644 index 00000000..7f8281bf --- /dev/null +++ b/requirements_2.txt @@ -0,0 +1 @@ +tables>=3.1.1