PaddleOCR - probably the best OCR tool available

Post your working scripts, libraries and tools for AHK v1.1 and older
guest3456
Posts: 3477
Joined: 09 Oct 2013, 10:31

Re: PaddleOCR - probably the best OCR tool available

Post by guest3456 » 21 Sep 2021, 21:01

works now. thanks. i didnt have the x64 redist, had to download it and reboot


leosouza85
Posts: 90
Joined: 22 Jul 2016, 16:28

Re: PaddleOCR - probably the best OCR tool available

Post by leosouza85 » 21 Sep 2021, 22:09

I keep gettin the error "please do not use whitespace in the path" when I click a sample file provided with the script

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 21 Sep 2021, 22:25

leosouza85 wrote:
21 Sep 2021, 22:09
I keep gettin the error "please do not use whitespace in the path" when I click a sample file provided with the script
That means your path contains whitespace characters.

use
x:\abc\paddleocr-autohotkey

instead of
x:\a bc\paddleocr-autohotkey

User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: PaddleOCR - probably the best OCR tool available

Post by thqby » 22 Sep 2021, 03:15

panddleoce.dll v1.0.0.1 supports model_dir that contains whitespace characters, it needs to be enclosed in double quotes.

william_ahk
Posts: 639
Joined: 03 Dec 2018, 20:02

Re: PaddleOCR - probably the best OCR tool available

Post by william_ahk » 22 Sep 2021, 04:39

Still getting blank msgbox for the latest release. Latest vc x64 redist installed. Is AMD Athlon(tm) II X4 640 too old for it?

leosouza85
Posts: 90
Joined: 22 Jul 2016, 16:28

Re: PaddleOCR - probably the best OCR tool available

Post by leosouza85 » 22 Sep 2021, 18:02

tuzi wrote:
21 Sep 2021, 22:25
leosouza85 wrote:
21 Sep 2021, 22:09
I keep gettin the error "please do not use whitespace in the path" when I click a sample file provided with the script
That means your path contains whitespace characters.

use
x:\abc\paddleocr-autohotkey

instead of
x:\a bc\paddleocr-autohotkey
It worked now, it was not that obvious, because the ahk directory did not had spaces, but it was on my desktop folder, and the root had an space...

Thanks!

hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: PaddleOCR - probably the best OCR tool available

Post by hasantr » 23 Sep 2021, 01:13

Did not work with PDF files. Because it doesn't already support?

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: PaddleOCR - probably the best OCR tool available

Post by malcev » 24 Sep 2021, 00:04

You can get hbitmap from pdf like this (win10)
viewtopic.php?p=368404#p368404

hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: PaddleOCR - probably the best OCR tool available

Post by hasantr » 25 Sep 2021, 13:50

malcev wrote:
24 Sep 2021, 00:04
You can get hbitmap from pdf like this (win10)
viewtopic.php?p=368404#p368404
Thanks malcev. :angel:

iseahound
Posts: 1582
Joined: 13 Aug 2016, 21:04
Contact:

Re: PaddleOCR - probably the best OCR tool available

Post by iseahound » 25 Sep 2021, 16:38

Ah, since you are using ImagePut this may be helpful.

Code: Select all

MsgBox, % PaddleOCR("test_en.png")
MsgBox, % PaddleOCR({file: "test_en.png"}) ; Force detection as a file.
AutoHotkey v1 has limitations regarding the clipboard, the function call PaddleOCR(ClipboardAll) is equal to PaddleOCR(""). This is because ClipboardAll must be on its own line.
Since the two versions of ImagePut for v2 and v1 are developed together, I decided to minimize the differences between the two versions.
Therefore if your input resolves to an empty string through an error, do not be confused if the function decides to OCR the clipboard.
I apologize and this problem does not exist on AHK v2 beta.
AutoHotkey v1 docs wrote: ClipboardAll is blank when used in ways other than those described above.

arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: PaddleOCR - probably the best OCR tool available

Post by arcticir » 25 Sep 2021, 22:08

How can I set it to be compatible with Chinese and Japanese?
I have downloaded the Japanese file but find that I cannot simply replace it.

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 29 Sep 2021, 22:28

thqby wrote:
22 Sep 2021, 03:15
panddleoce.dll v1.0.0.1 supports model_dir that contains whitespace characters, it needs to be enclosed in double quotes.
现在主要是dll文件本身路径带空格会有问题。
你要不要搞个链接放出来?我好引用。

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 29 Sep 2021, 22:29

iseahound wrote:
25 Sep 2021, 16:38
Ah, since you are using ImagePut this may be helpful.

Code: Select all

MsgBox, % PaddleOCR("test_en.png")
MsgBox, % PaddleOCR({file: "test_en.png"}) ; Force detection as a file.
AutoHotkey v1 has limitations regarding the clipboard, the function call PaddleOCR(ClipboardAll) is equal to PaddleOCR(""). This is because ClipboardAll must be on its own line.
Since the two versions of ImagePut for v2 and v1 are developed together, I decided to minimize the differences between the two versions.
Therefore if your input resolves to an empty string through an error, do not be confused if the function decides to OCR the clipboard.
I apologize and this problem does not exist on AHK v2 beta.
AutoHotkey v1 docs wrote: ClipboardAll is blank when used in ways other than those described above.
thanks, very usefull. :thumbup: :thumbup:

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 29 Sep 2021, 22:32

arcticir wrote:
25 Sep 2021, 22:08
How can I set it to be compatible with Chinese and Japanese?
I have downloaded the Japanese file but find that I cannot simply replace it.
i don't know.

because chinese model include english and chinese, so i guess maybe need to train a new model which include chinese and japanese.

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 29 Sep 2021, 22:33

william_ahk wrote:
22 Sep 2021, 04:39
Still getting blank msgbox for the latest release. Latest vc x64 redist installed. Is AMD Athlon(tm) II X4 640 too old for it?
yes.

william_ahk
Posts: 639
Joined: 03 Dec 2018, 20:02

Re: PaddleOCR - probably the best OCR tool available

Post by william_ahk » 29 Sep 2021, 23:46

@tuzi I see, nevermind :)

doubledave22
Posts: 346
Joined: 08 Jun 2019, 17:36

Re: PaddleOCR - probably the best OCR tool available

Post by doubledave22 » 02 Oct 2021, 11:58

thqby wrote:
22 Sep 2021, 03:15
panddleoce.dll v1.0.0.1 supports model_dir that contains whitespace characters, it needs to be enclosed in double quotes.
Any updates on this? I don't see panddleoce.dll anywhere and the whitespace issue is kind of a dealbreaker for me

iseahound
Posts: 1582
Joined: 13 Aug 2016, 21:04
Contact:

Re: PaddleOCR - probably the best OCR tool available

Post by iseahound » 02 Oct 2021, 20:26

Hi @tuzi,

I have a working upgrade to ImagePut.ahk that offers an exponential increase to the speed of ImagePutStream. The way you are currently using it will always converts the image to a pixel array and back. The new way will check for certain types such as file or url and prevent conversion to pixels for a very fast speed up (32 fps to over 2000 fps in my testing).
ImagePut v1.2 beta
Benchmark
Release Notes
Please make sure that PaddleOCR supports .bmp, .gif, .png, .jpg, and .tif.

I hope you enjoy, this was fun to write.

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: PaddleOCR - probably the best OCR tool available

Post by tuzi » 03 Oct 2021, 04:12

@iseahound
thank you so much!
i will update them later.

viv
Posts: 233
Joined: 09 Dec 2020, 17:48

Re: PaddleOCR - probably the best OCR tool available

Post by viv » 03 Oct 2021, 06:44

Thanks for sharing
Why can't I copy content to the clipboard?

Code: Select all

o := PaddleOCR(ClipboardAll)
MsgBox, % o
Clipboard := o
Even when I press CTRL +C on the msgbox, it causes it to disappear

Copying such a msgbox will get its contents and will not cause it to disappear

Code: Select all

o := "my text"
MsgBox, % o

Post Reply

Return to “Scripts and Functions (v1)”