Skip to content

select multi word #5

Open
Open

Description

@nikhilchh

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 ?

Activity

  1. not-implemented commented on Nov 22, 2018

    @not-implemented
    Owner

    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 :-)

  2. nikhilchh commented on Nov 22, 2018

    @nikhilchh
    Author

    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 .

  3. not-implemented commented on Nov 22, 2018

    @not-implemented
    Owner

    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);).

  4. nikhilchh commented on Nov 22, 2018

    @nikhilchh
    Author

    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.

  5. not-implemented commented on Nov 22, 2018

    @not-implemented
    Owner

    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 :-)

  6. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    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.

  7. not-implemented commented on Nov 23, 2018

    @not-implemented
    Owner

    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.

  8. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    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.

  9. not-implemented commented on Nov 23, 2018

    @not-implemented
    Owner

    Seems the CSS is missing. Just check for errors in the browser console/network tab, and maybe fix path in index.html

  10. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    Maybe my hocr is different from what your code expects.
    image

    error i get:

    image

    I think it is related to scan_res line 304 hocr-proofreader.js

    Someelse also had this issue i guess.

  11. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    I changed the code. and hard code the value to 300.
    image

    And now i got this:
    image

  12. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    Hovering on image is working but not on hocr (no boxes on hocr portion (right)). Getting closer :D

  13. nikhilchh commented on Nov 23, 2018

    @nikhilchh
    Author

    Also realised my hocr file doesn't have x_font and x_fsize.
    I think I will try to hard code this as well.

  14. not-implemented commented on Nov 23, 2018

    @not-implemented
    Owner

    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 ;-)

  15. ak2911 commented on May 15, 2019

    @ak2911

    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.

  16. not-implemented commented on May 15, 2019

    @not-implemented
    Owner

    @ak2911 you have to serve the application over a Webserver - or use Firefox - it supports loading local files via AJAX.

  17. ak2911 commented on May 17, 2019

    @ak2911

    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.

  18. not-implemented commented on May 17, 2019

    @not-implemented
    Owner

    The whole project is still a proof-of-concept of the GUI ... there are still a lot of things to do :-)

  19. ak2911 commented on May 17, 2019

    @ak2911

    Thank you :) . Will try to check at my End. Once again thanks for the utility and your replies :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions