Giter Site home page Giter Site logo

Comments (10)

jboarman avatar jboarman commented on May 30, 2024 2

My preference is to focus our library of named augmentations around effects associated with printing, scanning, copying, faxing, etc that are more easily and naturally expressed by business people that might describe the effect they wish to see represented.

This allows us to use recognizable metaphors representing the digital effects being applied. For example, "dirty rollers" is a metaphor (or is it a metonymy? πŸ€”) for the effect you see when scanning a document using a well-worn scanner that has those dirty roller lines that appear on the scanned image. This effect was derived from scanned images observed in various scanned document collections.

We may indeed end up with different classes of effects that have little or no relationship to a real-world and nameable effect like "Letterpress". If we end up with such augmentations that can only yield desired metaphor-driven effects after combining with other augmentations, then we are more closely aligning ourselves with base-level "Photoshop effects" instead of higher-order real-world effects. Such lower-order effects would need a different way of organizing, such as using categories more closely resembling imgaug's use of categories, like meta, arithmetic, artistic, blend, blur, color, contrast, convolutional, geometric, etc.

So, instead of creating a catalog of lower-order effects as augmentations, I'd rather see us create a shared library of functions that can be internally applied through that common library of micro effects as pure vector functions (image vector in -> image vector out). This further reduces the ceremony and overhead of calling them when an augmentation is composed of these library functions.

Where this gets tricky is getting stuck in an analysis-paralysis loop when assessing whether an effect belongs in the shared lib or as a proper augmentation. I propose that DustyInk and LowInkBlob are not effect seen in the wild on their own and will always be combined in some fashion with each other and / or other effects to be useful.

Further, if asking a business person to describe an issue, they might say a particular problem with a document was that the printer was running low on ink. So, then, we should have an augmentation in sync with that language called a "LowInk" augmentation. From there, we could have options for printer type (inkjet, laser, etc) and options to override any defaults such as controlling whether low ink lines are randomly included or not, etc.

But, before taking on that scope of revamping all the low-ink related augmentations, I figure we should get it right with this simpler issue by first setting up a common, shared library of lower-order effects that can be internally composed within augmentations to build a more business-friendly set of higher-order augmentations.

from augraphy.

jboarman avatar jboarman commented on May 30, 2024 1

It might be best to wait on the composabilty refactoring that @proofconstruction is working on first. This should be a trivial change once that is completed.

from augraphy.

kwcckw avatar kwcckw commented on May 30, 2024

I think this should be related to generalize the function? So combining "Dusty Ink" and "Ink Blobs" to mimic the Letterpress augmentation may be actually one of them. And eventually it will be easier for the user , they may just selecting some predefined style instead of creating their own pipeline.

from augraphy.

kwcckw avatar kwcckw commented on May 30, 2024

If we merge these 2 operations, it should be a new augmentation? Or for now we will make it a new augmentation first until we finalized on composability of the code?

from augraphy.

proofconstruction avatar proofconstruction commented on May 30, 2024

The solution to the composability problem for augmentations was staring me in the face the whole time: if you want Augmentation3 to be the composition of Augmentation1 and Augmentation2, you just need to set
Augmentation3 = AugmentationSequence([Augmentation1(), Augmentation2()])
and call Augmentation3 in the pipeline. Easy!

@jboarman Is the intent of this issue to create a new augmentation which combines Dusty Ink and Ink Blobs, and then remove those as separate augmentations?

from augraphy.

kwcckw avatar kwcckw commented on May 30, 2024

The solution to the composability problem for augmentations was staring me in the face the whole time: if you want Augmentation3 to be the composition of Augmentation1 and Augmentation2, you just need to set
Augmentation3 = AugmentationSequence([Augmentation1(), Augmentation2()])
and call Augmentation3 in the pipeline. Easy!

Is it possible t import those augmentation in another augmentation?

For example, i need dustyink and lowinkblob in bleedthrough augmentation. What would be the best approach to do so? Import them and use them individually?

from augraphy.

proofconstruction avatar proofconstruction commented on May 30, 2024

Currently the library is not set up for augmentations to be used as normal functions in other augmentations.

The best way to use these right now is to import them, create the augmentation object, apply it with DustyInkAugmentation(p=1)(image), then get the result back from data[layer][-1].result and use that in the next augmentation. You can do this several times, and then maybe at the end of Bleedthrough you can return the AugmentationResult with metadata, maybe a string saying you used DustyInk and LowInkBlob as part of Bleedthrough. Right now we don’t use the metadata field of AugmentationResult, and I expect it will mostly be used for debugging in the future, so this should be fine.

from augraphy.

proofconstruction avatar proofconstruction commented on May 30, 2024

#31 addresses most of this issue, but I haven't done anything about the parameters yet.

To make parameters more friendly, we could refactor everything to accept keyword args, so all the optional arguments could be safely ignored in any function or augmentation call, but this is a significant undertaking. If we want to go that direction - and I think we should - I'd like to do it now before the project grows further. There is precedent for doing this in the ecosystem: Albumentations already does this.

from augraphy.

proofconstruction avatar proofconstruction commented on May 30, 2024

Letterpress is now in augraphy.augmentations and has replaced calls to Dusty Ink and Low Ink Blobs in the default pipeline.

from augraphy.

proofconstruction avatar proofconstruction commented on May 30, 2024

Finally removed Dusty Ink and Ink Blobs

from augraphy.

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.