Tiling and Corruption (TACo)
TACo is a simple and effective data augmentation technique for the task of Optical Character Recognition (OCR) or Handwritten Text Recognition (HTR) (check reference).
And, taco-box is an implementation of TACo algorithm. This is currently under the Apache 2.0, Please feel free to use for your project. Enjoy!
Installing
First, you need to have python 3 installed in your system.
Next, you can Install taco-box with pip or your favorite PyPi package manager.
pip install taco-box
Usage
Checkout this jupyter notebook on usage - Notebook
Here is an example:
from tacobox import Taco
# creating Taco object. (Note: parameters are at their default value.)
mytaco = Taco(cp_vertical=0.25,
cp_horizontal=0.25,
max_tw_vertical=100,
min_tw_vertical=20,
max_tw_horizontal=50,
min_tw_horizontal=10
)
# apply random vertical corruption
augmented_img = mytaco.apply_vertical_taco(input_img, corruption_type='random')
mytaco.visualize(augmented_img)
-------Understanding Arguments--------
:cp_vertical: corruption probability of vertical tiles
:cp_horizontal: corruption probability for horizontal tiles
:max_tw_vertical: maximum possible tile width for vertical tiles in pixels
:min_tw_vertical: minimum tile width for vertical tiles in pixels
:max_tw_horizontal: maximum possible tile width for horizontal tiles in pixels
:min_tw_horizontal: minimum tile width for horizontal tiles in pixels
Expected results
Below picture shows the variations of TACo augmentation algorithm from current implementation:-
Contributing
This project is in very early stages of development. If there is an issue or feature request, feel free to open an issue. Additionally, a PR is always welcome.
Reference
TACo algorithm is part of a research project on Handwritten Text Recognition. Link to the original paper will be posted soon!!
Metadata
Release files for taco-box 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| taco-box-0.1.1.tar.gz | 3.6 kB | Without provenance | Details for taco-box-0.1.1.tar.gz |
Release files / taco-box-0.1.1.tar.gz
| Download URL | taco-box-0.1.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
526ba2af3ce617baaf56284fbf238e0a2b8038d14588f05a9889fb4ede76a68d
|
|
BLAKE2b-256 checksum How to use checksums |
ec67796dfdda08f47cf094ab25f979437236e2bcc70952eed3365276a5e5b937
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Security for taco-box 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.