Comments (10)
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?
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.
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.
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.
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.
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.
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.
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.
#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.
Letterpress is now in augraphy.augmentations
and has replaced calls to Dusty Ink and Low Ink Blobs in the default pipeline.
from augraphy.
Finally removed Dusty Ink and Ink Blobs
from augraphy.
Related Issues (20)
- Callable pipeline HOT 2
- Develop Augmentations that Simulate Images Taken by Camera Phone HOT 1
- Add Pattern-based Distortion Generator HOT 6
- Add `InkShifter` Augmentation to Shift Ink Pixels Randomly and Follow Background Shadows
- Add Wrinkled, Crumpled Paper Augmentation HOT 1
- Create Utility Function for Exposing Underlying Pixel Colors
- Empty Pipeline lowers image quality HOT 12
- Add Augmentation for Shadows Cast onto Camera-Sourced Document Images HOT 1
- Create Baseline Performance Benchmark; Apply Initial Optimizations Using Numba HOT 2
- Create Example Using Dataloader for PyTorch and TensorFlow HOT 1
- Add Python 3.11 Support, Drop Python 3.7 HOT 2
- Images Broken in PyPI Listing HOT 2
- Reflected Light from Camera Flash or other Bright Sources HOT 1
- Add Color Shifting / 3D Blur Effect HOT 4
- Improve PageBorder effect HOT 1
- Add support for bounding box, keypoints and mask. HOT 1
- Add `InkColorSwap` to Replace the Color Used for Lettering in a Document HOT 1
- Add `InkMottling` Augmentation to Ensure Ink is Non-Uniform HOT 1
- Add support for image with alpha layer. HOT 1
- Color range in InkBleed is not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from augraphy.