Giter VIP home page Giter VIP logo

Comments (6)

bertsky avatar bertsky commented on August 22, 2024

To the latter: perhaps in core we should offer a filter based on the filename directly (instead of the image features). Something like Workspace.image_from_page(... filename=None ...) and similar for image_from_segment. Of course, both parameters might interact, so if both filename and feature_filter / feature_selector are given, then one would have to verify that the image with that filename also fulfills these features.

What do you think, @kba?

from browse-ocrd.

bertsky avatar bertsky commented on August 22, 2024

Oh, it's not as easy though: Even with a @filename filter, we cannot just use that to configure our ImageVersionSelector, because obviously the path name changes for each page. @hnesk IIUC your approach was to use the selector only to retrieve its image features, and then pass that on to get_image. But what if the image with the right features does not exist and cannot be downloaded? For core, we would have to try and download each AlternativeImage to rule that out (which seems like a waste of resources)...

from browse-ocrd.

hnesk avatar hnesk commented on August 22, 2024

To the latter: perhaps in core we should offer a filter based on the filename directly (instead of the image features).

I build the ImageVersionSelector around the notion of features, because Workspace.image_from_page expects it that way, if there would a filename filter, I would happily use that.

Oh, it's not as easy though: Even with a @filename filter, we cannot just use that to configure our ImageVersionSelector, because obviously the path name changes for each page.

No problem here: The ImageVersionSelector gets configured for each page individually with the current AlternativeImages and their filenames.

I think your fix in #38 fixes the problem already. Do you have an example workspace?

from browse-ocrd.

bertsky avatar bertsky commented on August 22, 2024

if there would a filename filter, I would happily use that.

No problem here: The ImageVersionSelector gets configured for each page individually with the current AlternativeImages and their filenames.

Oh, in that case – we should go for it. ocrd_browser would not have to mess with the image feature mechanism. See https://github.com/bertsky/core/tree/workspace-altimg-retrieve-existing for the preliminaries in core. The next step would be to (wait for approval+merge in core) and then utilize it in get_image.

I think your fix in #38 fixes the problem already. Do you have an example workspace?

No, only the first half – see above. For an example, it suffices to take any valid PAGE-XML and add an AlternativeImage to it with no @comments and a non-existing @filename.

from browse-ocrd.

hnesk avatar hnesk commented on August 22, 2024

Ok, I got it now! It really is necessary to distinguish the images by filename, so it would be great if your branch gets merged.

from browse-ocrd.

bertsky avatar bertsky commented on August 22, 2024

Ok, so let's wait for OCR-D/core#845

from browse-ocrd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.