Closed dniku closed 9 years ago
Did you download the model in binary mode?
That particular page and example is in Fraktur (traditional German script), not English, so you need a different model.
I am getting the same problem while loading the model in windows. what should i do? the error message is as follows
$ ./run-test
INFO: # ./tests/testpage.png
INFO: === ./tests/testpage.png 1
INFO: estimating skew angle
INFO: estimating thresholds
INFO: rescaling
INFO: ./tests/testpage.png lo-hi (0.39 1.44) angle 0.1 no-normalization
INFO: writing
INFO:
INFO: ########## C:/Users/allud/ocropy/env/Scripts/ocropus-gpageseg temp/????
INFO:
INFO: temp\0001.bin.png
INFO: scale 19.493589
INFO: computing segmentation
INFO: computing column separators
INFO: considering at most 3 whitespace column separators
INFO: computing lines
INFO: propagating labels
INFO: spreading labels
INFO: number of lines 100
INFO: finding reading order
INFO: writing lines
INFO: 91 temp\0001.bin.png 19.5 92
INFO:
INFO: ########## C:/Users/allud/ocropy/env/Scripts/ocropus-rpred -n temp/????
INFO:
INFO: #inputs: 92
# loading object .\models\en-default.pyrnn.gz
Traceback (most recent call last):
File "C:/Users/allud/ocropy/env/Scripts/ocropus-rpred", line 120, in <module>
network = ocrolib.load_object(args.model,verbose=1)
File "c:\python27\Lib\ocrolib\common.py", line 445, in load_object
return unpickler.load()
EOFError
(env)
In version 1.3.3 I found the common.py is opening the model using gunzip, which is not available on Windows natively. Adding an import gzip, uncommenting line 442 and commenting out 443 resolved the issue for me.
Here's the traceback (I edited the path to \ocropy):
0001.bin.png
is:fraktur.pyrnn.gz
is freshly downloaded from http://www.tmbdev.net/fraktur.pyrnn.gz. I am running Win7 x64 and Python 2.7.6 x64.Also, why do the instructions first suggest downloading
en-default.pyrnn.gz
and then running withfraktur.pyrnn.gz
?