-
Notifications
You must be signed in to change notification settings - Fork 0
/
learn.py
60 lines (38 loc) · 1.96 KB
/
learn.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## learn how to NLTK
# more Rest API
# sentiment
# OCR from pictures, put in list, LIDL
# learn Docker
# Kibana dashboard
brew install tesseract --with-all-languages
ocrmypdf - l de IMG0001.jpg LeParisien.pdf
tesseract IMG0001.jpg output-prefix pdf
ocrmypdf --sidecar output.txt IMG0001.jpg output.pdf # geht nicht
ocrmypdf -l deu --sidecar output.txt IMG_1052.HEIC.pdf output.pdf
ocrmypdf --sidecar output.txt IMG_1052.HEIC.pdf output.pdf
# Language German
https://www.heise.de/ct/artikel/Toolbox-Texterkennung-mit-OCRmyPDF-2356670.html
# as PDF
ocrmypdf --sidecar output_eng.txt Lidl_Rechnung.pdf output.pdf
ocrmypdf -l deu --sidecar output_german.txt Lidl_Rechnung.pdf output.pdf
# as JPG
ocrmypdf --sidecar output_eng.txt Lidl_Rechnung.jpg output.pdf
ocrmypdf -l deu --sidecar output_german.txt Lidl_Rechnung.jpg output.pdf
# as PDF
ocrmypdf --sidecar output_eng.txt IMG_1057.HEIC.pdf output_LIDL.pdf
ocrmypdf -l deu --sidecar output_german.txt IMG_1057.HEIC.pdf output_LIDL.pdf
## Evaluation Exp1: Input File 72 MB = works
ocrmypdf --sidecar output_eng.txt IMG_1057.HEIC.pdf output_LIDL.pdf
ocrmypdf -l deu --sidecar output_ger.txt IMG_1057.HEIC.pdf output_LIDL.pdf
## Evaluation Exp2: Input File - output = none
ocrmypdf --sidecar output_eng.txt Lidl_Rechnung.jpg output_LIDL.pdf
ocrmypdf -l deu --sidecar output_ger.txt Lidl_Rechung.jpeg output_LIDL.pdf
## Evaluation Exp3: Input File - output = none
ocrmypdf --sidecar output_eng.txt Lidl_Rechnung_jpg2pdf.pdf output_LIDL.pdf
ocrmypdf -l deu --sidecar output_ger.txt Lidl_Rechnung_jpg2pdf.pdf output_LIDL.pdf
## Evaluation Exp4: file from Exp1, but exported as jpg with highest quality, numbers are lost?
ocrmypdf --sidecar output_eng.txt IMG_1057.jpg output_LIDL.pdf
ocrmypdf -l deu --sidecar output_ger.txt IMG_1057.jpg output_LIDL.pdf
## Evaluation Exp5: file from Exp4, but with cut borders
ocrmypdf --sidecar output_eng.txt IMG_1057.jpg output_LIDL.pdf
ocrmypdf -l deu --sidecar output_ger.txt IMG_1057.jpg output_LIDL.pdf