ReceiptManager / receipt-parser-legacy

A supermarket receipt parser written in Python using tesseract OCR

Home Page:https://tech.trivago.com/2015/10/06/python_receipt_parser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make docker-run not working

esale opened this issue · comments

commented

Hi people,

today I'm evaluating your project, but when I run make docker-run it gives me an error:

docker run -v `pwd`/data/img:/app/data/img mre0/receipt-parser
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/app/parser/__init__.py", line 5, in main
    receipt_files = get_files_in_folder(config.receipts_path)
  File "/app/parser/parse.py", line 57, in get_files_in_folder
    files = os.listdir(os.path.join(BASE_PATH,folder))  # list content of folder
FileNotFoundError: [Errno 2] No such file or directory: '/app/data/txt'
make: *** [Makefile:26: docker-run] Error 1

Next, I tried with the suggested command:

$ docker run -v "$(pwd)/data/img:/usr/src/app/data/img" mre0/receipt-parser
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/app/parser/__init__.py", line 5, in main
    receipt_files = get_files_in_folder(config.receipts_path)
  File "/app/parser/parse.py", line 57, in get_files_in_folder
    files = os.listdir(os.path.join(BASE_PATH,folder))  # list content of folder
FileNotFoundError: [Errno 2] No such file or directory: '/app/data/txt'

then, with

$ docker run -v "$(pwd)/data/img:/usr/src/app/data/img" -v "$(pwd)/data/txt:/app/data/txt:rw" mre0/receipt-parser
Text, Market, Date, Sum
1587323551,0,0,0,0,

Then, I erased all images in data/img, and it gave more or less the same result, the first number changes, and that's it.

Am I doing something wrong?

Regards.

I have the same issue, it is neither working with the sample images nor with my own.

I got it working with:
podman run --name receipt --privileged -v "$(pwd)/receipt_input/img:/app/data/img" -v "$(pwd)/receipt_input/txt:/app/data/txt:rw" mre0/receipt-parser

Thanks for the feedback @gnu300.
@esale can you try to mount the image folder like @gnu300 did?
E.g. -v "$(pwd)/data/img:/app/data/img"

commented

Hi @mre, similar result as before.

$ docker run -v "$(pwd)/data/img:/usr/src/app/data/img" -v "$(pwd)/data/txt:/app/data/txt:rw" mre0/receipt-parser
Text, Market, Date, Sum
1601955082,0,0,0,0,

$ docker  run --name receipt --privileged -v "$(pwd)/data/img:/app/data/img" -v "$(pwd)/data/txt:/app/data/txt:rw" mre0/receipt-parser
Text, Market, Date, Sum
1601955003,0,0,0,0,`

@mre, @gnu300, can you share some results, for instance from the sample images?

commented

i don't know if it's just me but i expected this to run ocr on the images in data/img and parse them but, as far as i can tell the docker file only runs the parser.

Hi @esale, am kind of new to docker and am trying to work my way around it. What does mre0/receipt-parser represent in your local set up.
Thanks in advance.

commented

@petermusembi69

Hi @esale, am kind of new to docker and am trying to work my way around it. What does mre0/receipt-parser represent in your local set up.
Thanks in advance.

It's the name of the image to run. It's stated on the example at the end of this project's main page (https://github.com/ReceiptManager/Parser)

docker run -v <path_to_input_images>:/usr/src/app/data/img mre0/receipt-parser

For further reading:

https://docker-curriculum.com/#docker-run

Regards.

Is this issue resolved @petermusembi69 ?

@monolidth yes it is, the response from @esale is satisfactory.