{"id":18653314,"url":"https://github.com/roatienza/straug","last_synced_at":"2025-04-05T06:07:41.099Z","repository":{"id":39483245,"uuid":"336211343","full_name":"roatienza/straug","owner":"roatienza","description":"Image transformations designed for Scene Text Recognition (STR) data augmentation. Published at ICCV 2021 Workshop on Interactive Labeling and Data Augmentation for Vision.","archived":false,"fork":false,"pushed_at":"2024-06-24T05:51:28.000Z","size":2676,"stargazers_count":255,"open_issues_count":7,"forks_count":36,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T05:05:57.410Z","etag":null,"topics":["data-augmentation","scene-text-recognition","str"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roatienza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-05T08:34:39.000Z","updated_at":"2025-03-19T11:54:26.000Z","dependencies_parsed_at":"2024-11-07T07:11:11.518Z","dependency_job_id":"f6a74677-8195-4536-b0f2-4827b87f6722","html_url":"https://github.com/roatienza/straug","commit_stats":{"total_commits":55,"total_committers":4,"mean_commits":13.75,"dds":0.509090909090909,"last_synced_commit":"18374b08360ccda5bc01811c17336bd73cf87270"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roatienza%2Fstraug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roatienza%2Fstraug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roatienza%2Fstraug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roatienza%2Fstraug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roatienza","download_url":"https://codeload.github.com/roatienza/straug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294538,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-augmentation","scene-text-recognition","str"],"created_at":"2024-11-07T07:11:07.843Z","updated_at":"2025-04-05T06:07:41.075Z","avatar_url":"https://github.com/roatienza.png","language":"Python","readme":"# Data Augmentation for Scene Text Recognition\n(Pronounced as \"_strog_\")\n\n### Paper\n\n\n* [ICCV 2021 Workshop](https://openaccess.thecvf.com/content/ICCV2021W/ILDAV/papers/Atienza_Data_Augmentation_for_Scene_Text_Recognition_ICCVW_2021_paper.pdf)\n* [Arxiv](https://arxiv.org/abs/2108.06949)\n\n## Why it matters?\n\nScene Text Recognition (STR) requires data augmentation functions that are different from object recognition. STRAug is data augmentation designed for STR. It offers 36 data augmentation functions that are sorted into 8 groups. Each function supports 3 levels or magnitudes of severity or intensity.\n\nGiven a source image:\n\n![](/examples/source/delivery.png) \n\nit can be transformed as follows:\n\n1) `warp.py` - to generate `Curve`, `Distort`, `Stretch` (or Elastic) deformations\n\n`Curve` | `Distort` | `Stretch`\n------------ | ------------- | -------------\n![](/examples/warp/Curve-2.png) | ![](/examples/warp/Distort-1.png) | ![](/examples/warp/Stretch-1.png)\n\n2) `geometry.py` - to generate `Perspective`, `Rotation`, `Shrink` deformations\n\n`Perspective` | `Rotation` | `Shrink`\n------------ | ------------- | -------------\n![](/examples/geometry/Perspective-1.png) | ![](/examples/geometry/Rotate-0.png) | ![](/examples/geometry/Shrink-1.png)\n\n\n3) `pattern.py` - to create different grids: `Grid`, `VGrid`, `HGrid`, `RectGrid`, `EllipseGrid`\n\n`Grid`| `VGrid`| `HGrid` | `RectGrid` | `EllipseGrid`\n------------ | ------------- | ------------- | ------------- | -------------\n![](/examples/pattern/Grid-0.png) | ![](/examples/pattern/VGrid-0.png) | ![](/examples/pattern/HGrid-0.png) | ![](/examples/pattern/RectGrid-0.png) | ![](/examples/pattern/EllipseGrid-0.png)\n\n\n4) `blur.py` - to generate synthetic blur: `GaussianBlur`, `DefocusBlur`, `MotionBlur`, `GlassBlur`, `ZoomBlur`\n\n`GaussianBlur` | `DefocusBlur` | `MotionBlur` | `GlassBlur` | `ZoomBlur`\n------------ | ------------- | ------------- | ------------- | -------------\n![](/examples/blur/GaussianBlur-2.png) | ![](/examples/blur/DefocusBlur-1.png) | ![](/examples/blur/MotionBlur-1.png) | ![](/examples/blur/GlassBlur-1.png) | ![](/examples/blur/ZoomBlur-1.png)\n\n\n5) `noise.py` - to add noise: `GaussianNoise`, `ShotNoise`, `ImpulseNoise`, `SpeckleNoise`\n\n`GaussianNoise` | `ShotNoise` | `ImpulseNoise` | `SpeckleNoise`\n------------ | ------------- | ------------- | ------------- \n![](/examples/noise/GaussianNoise-2.png) | ![](/examples/noise/ShotNoise-2.png) | ![](/examples/noise/ImpulseNoise-2.png) | ![](/examples/noise/SpeckleNoise-2.png) \n\n6) `weather.py` - to simulate certain weather conditions: `Fog`, `Snow`, `Frost`, `Rain`, `Shadow`\n\n`Fog` | `Snow` | `Frost` | `Rain` | `Shadow`\n------------ | ------------- | ------------- | ------------- | -------------\n![](/examples/weather/Fog-2.png) | ![](/examples/weather/Snow-1.png) | ![](/examples/weather/Frost-2.png) | ![](/examples/weather/Rain-1.png) | ![](/examples/weather/Shadow-2.png)\n\n7) `camera.py` - to simulate camera sensor tuning and image compression/resizing: `Contrast`, `Brightness`, `JpegCompression`, `Pixelate`\n\n`Contrast` | `Brightness` | `JpegCompression` | `Pixelate`\n------------ | ------------- | ------------- | ------------- \n![](/examples/camera/Contrast-2.png) | ![](/examples/camera/Brightness-2.png) | ![](/examples/camera/JpegCompression-2.png) | ![](/examples/camera/Pixelate-2.png) \n\n8) `process.py` - all other image processing issues: `Posterize`, `Solarize`, `Invert`, `Equalize`, `AutoContrast`, `Sharpness`, `Color`\n\n`Posterize` | `Solarize` | `Invert` | `Equalize`\n------------ | ------------- | ------------- | ------------- \n![](/examples/process/Posterize-2.png) | ![](/examples/process/Solarize-2.png) | ![](/examples/process/Invert-2.png) | ![](/examples/process/Equalize-2.png)\n\n`AutoContrast` | `Sharpness` | `Color`\n------------ | ------------- | ------------- \n![](/examples/process/AutoContrast-2.png) | ![](/examples/process/Sharpness-2.png) | ![](/examples/process/Color-2.png) \n\n\n## Pip install\n\n```\npip3 install straug\n```\n\n## How to use\n\nCommand line (e.g. input image is `nokia.png`):\n\n```\n\u003e\u003e\u003e from straug.warp import Curve\n\u003e\u003e\u003e from PIL import Image\n\u003e\u003e\u003e img = Image.open(\"nokia.png\")\n\u003e\u003e\u003e img = Curve()(img, mag=3)\n\u003e\u003e\u003e img.save(\"curved_nokia.png\")\n```\n\nPython script (see `test.py`):\n\n`python3 test.py --image=\u003ctarget image\u003e`\n\nFor example:\n\n`python3 test.py --image=images/telekom.png `\n\nThe corrupted images are in `results` directory.\n\n*If you want to randomly apply only the desired augmentation types among multiple augmentations, see `test_random_aug.py`*\n\n\n## Reference\n  - Image corruptions (eg blur, noise, camera effects, fog, frost, etc) are based on the work of [Hendrycks et al.](https://github.com/hendrycks/robustness)\n\n\n## Citation\nIf you find this work useful, please cite:\n\n```\n@inproceedings{atienza2021data,\n  title={Data Augmentation for Scene Text Recognition},\n  author={Atienza, Rowel},\n  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},\n  pages={1561--1570},\n  year={2021}\n}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froatienza%2Fstraug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froatienza%2Fstraug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froatienza%2Fstraug/lists"}