ocropus-archive / DUP-ocropy

Python-based tools for document analysis and OCR
Apache License 2.0
3.41k stars 590 forks source link

I can't run the test #325

Closed mahmoudben96 closed 5 years ago

mahmoudben96 commented 5 years ago

Hello everybody,

I'm working on Windows 10. I downloaded Ocropy and I installed Python 2.7.15 with the packages mentionned in the requirements.txt and I ran the setup.py file.

I wanted to test this exemple mentionned in the github page Ocropy :

perform binarization

./ocropus-nlbin tests/ersch.png -o book

perform page layout analysis

./ocropus-gpageseg 'book/????.bin.png'

perform text line recognition (on four cores, with a fraktur model)

./ocropus-rpred -Q 4 -m models/fraktur.pyrnn.gz 'book/????/??????.bin.png'

generate HTML output

./ocropus-hocr 'book/????.bin.png' -o ersch.html

However, the first command (python ./ocropus-nlbin tests/ersch.png -o book) works eventhough I have a warning message. But the second command (python ./ocropus-gpageseg 'book/????.bin.png') doesn't work.

C:\Users\Mahmoud\Desktop\ocropy-master>python ocropus-nlbin tests/ersch.png -o book INFO: # tests/ersch.png INFO: === tests/ersch.png 1 INFO: flattening C:\Users\Mahmoud\AppData\Roaming\Python\Python27\site-packages\scipy\ndimage\interpolation.py:605: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed. "the returned array has changed.", UserWarning) INFO: estimating skew angle INFO: estimating thresholds INFO: rescaling INFO: tests/ersch.png lo-hi (0.00 1.00) angle 0.0 INFO: writing

C:\Users\Mahmoud\Desktop\ocropy-master>python ./ocropus-gpageseg '/book/????.bin.png' Traceback (most recent call last): File "./ocropus-gpageseg", line 107, in args.files = ocrolib.glob_all(args.files) File "C:\Users\Mahmoud\Desktop\ocropy-master\ocrolib\toplevel.py", line 218, in argument_checks result = f(*args,**kw) File "C:\Users\Mahmoud\Desktop\ocropy-master\ocrolib\common.py", line 573, in glob_all raise FileNotFound("%s: expansion did not yield any files"%arg) ocrolib.exceptions.FileNotFound: file not found '/book/????.bin.png': expansion did not yield any files

In addition the command (python ./run-test) doesn't work either.

C:\Users\Mahmoud\Desktop\ocropy-master>python ./run-test File "./run-test", line 3 BASE=$(dirname $0) ^ SyntaxError: invalid syntax

I've checked out the 2 issues : https://github.com/tmbdev/ocropy/issues/81 and https://github.com/tmbdev/ocropy/pull/65 but my problem is slightly different.

Thank you for your help.

zuphilip commented 5 years ago

ocrolib.exceptions.FileNotFound: file not found '/book/????.bin.png': expansion did not yield any files

What is after the first step in your book subdirectory?

BASE=$(dirname $0) ^ SyntaxError: invalid syntax

What terminal are you using? run-test is a shell script and I guess that the normal windows command line will not work for this...

zuphilip commented 5 years ago

Closing this issue because of inactivity. If the problem remains, then feel free to reopen it.

UlasSAYGINIM commented 3 years ago

hi this problem continues. i think because of directory representation difference between pc and unix/linux.

it gives error like. i tried both / and \ for last section of directory of temp1 but no luck. i think , software only understands linux like paths for wilcards.

ocrolib.exceptions.FileNotFound: file not found 'C:\ocropus\temp1/????.bin.png': expansion did not yield any files

UlasSAYGINIM commented 3 years ago

can someone test on windows 10 with python 2.7.16, thank you. in fact, windows does not have terminal like. and ./run-test does not work. i tried python commands in it.