hocr-proofreader
hocr-proofreader copied to clipboard
select multi word
is there a way to enhance it in a way that i can select multiple words from hovering UI. And then use the combined content and combined bounding box to annotate things ?
That's the plan :-) ... When having more time, I'll implement all that editing features ... currently it's more a reader than an editor ;-) Contributions are welcome :-)
Thanks for the reply.
Can you tell what do I have to modify to make it work my local image and hocr file. ? Do I just have to provide the path of hocr and image somewhere in the code ? I tried to make a demo folder and added .hocr and .jpg there. But no success yet.
NOTE: I am very new to javascript/html .
Just think of "main.js"/"index.html" as an example how to use the library.
There you can specify an URL for the hOCR file. The images should be referenced inside the hocr-file as relative path (relative to the baseUrl which is also set via hocrProofreader.setHocr(hocr, hocrBaseUrl);
).
OK, but in your example code, there is no hocr file and image. Can you please send your demo.hocr file so that I can see how exactly you write the information about the image inside hocr file.
And instead of passing URL can i just specify the path of the base directory where i keep .hocr file ?
The demo web link you have shared has a demo folder which contains pag1.jpg but there is not hocr file in that folder.
Sure, the hOCR-File is referenced here as relative URL with the base directory (an URL can always be a relative path ;-)): https://github.com/not-implemented/hocr-proofreader/blob/master/main.js#L35
Just inspect my demo installation for the hOCR-File which is here: https://www.not-implemented.de/hocr-proofreader/demo/demo.hocr
The "page1.jpg" is rerefenced in the hOCR file (relative to the basePath):
<div class='ocr_page' id='page_1' title='image "page1.jpg"; bbox 0 0 2480 3507; ppageno 0'>
So is is loaded from: https://www.not-implemented.de/hocr-proofreader/demo/page1.jpg :-)
ok cool. thanks for the detailed response. Does the image has to be "jpg" format only ? Because I wasn't successful with png or jpeg format.
OK. I was able to make it work. But no hovering or blue boxes. I can see image and hocr text now.
All images supported by browsers should be fine. From this librarys point of view it's just a path/URL which is displayed as image by the browser. I do not know why PNG should not work.
OK. I was able to make it work. But no hovering or blue boxes. I can see image and hocr text now.
Do I have to turn it on or something.
Seems the CSS is missing. Just check for errors in the browser console/network tab, and maybe fix path in index.html
Maybe my hocr is different from what your code expects.
error i get:
I think it is related to scan_res line 304 hocr-proofreader.js
Someelse also had this issue i guess.
I changed the code. and hard code the value to 300.
And now i got this:
Hovering on image is working but not on hocr (no boxes on hocr portion (right)). Getting closer :D
Also realised my hocr file doesn't have x_font and x_fsize. I think I will try to hard code this as well.
Yes there may be a lot of small things that differ in hOCR files. Currently I focused on implementing the UI. When having more time, I'll improve the hOCR details.
For now you have to patch those hardcoded things until it fits your needs ;-)
getting error : "Error loading url "demo/demo.hocr": HTTP connection error". have placed demo.hocr and page1.jpg in demo folder. could you please suggest.
@ak2911 you have to serve the application over a Webserver - or use Firefox - it supports loading local files via AJAX.
Thanks for your reply. Not in Firefox, but it loaded in web server. Also image-hocr click/pointing not working other than header text. Any suggestion if you could please provide.
The whole project is still a proof-of-concept of the GUI ... there are still a lot of things to do :-)
Thank you :) . Will try to check at my End. Once again thanks for the utility and your replies :)