You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :-)
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.
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.
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.
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.
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.
Activity
not-implemented commentedon Nov 22, 2018
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 :-)
nikhilchh commentedon Nov 22, 2018
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 .
not-implemented commentedon Nov 22, 2018
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);).nikhilchh commentedon Nov 22, 2018
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.
not-implemented commentedon Nov 22, 2018
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):
So is is loaded from: https://www.not-implemented.de/hocr-proofreader/demo/page1.jpg :-)
nikhilchh commentedon Nov 23, 2018
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.
not-implemented commentedon Nov 23, 2018
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.
nikhilchh commentedon Nov 23, 2018
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.
not-implemented commentedon Nov 23, 2018
Seems the CSS is missing. Just check for errors in the browser console/network tab, and maybe fix path in index.html
nikhilchh commentedon Nov 23, 2018
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.
nikhilchh commentedon Nov 23, 2018
I changed the code. and hard code the value to 300.

And now i got this:

nikhilchh commentedon Nov 23, 2018
Hovering on image is working but not on hocr (no boxes on hocr portion (right)). Getting closer :D
nikhilchh commentedon Nov 23, 2018
Also realised my hocr file doesn't have x_font and x_fsize.
I think I will try to hard code this as well.
not-implemented commentedon Nov 23, 2018
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 ;-)
ak2911 commentedon May 15, 2019
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.
not-implemented commentedon May 15, 2019
@ak2911 you have to serve the application over a Webserver - or use Firefox - it supports loading local files via AJAX.
ak2911 commentedon May 17, 2019
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.
not-implemented commentedon May 17, 2019
The whole project is still a proof-of-concept of the GUI ... there are still a lot of things to do :-)
ak2911 commentedon May 17, 2019
Thank you :) . Will try to check at my End. Once again thanks for the utility and your replies :)