{"id":13525900,"url":"https://github.com/codebox/image_augmentor","last_synced_at":"2025-06-12T12:13:34.042Z","repository":{"id":38801267,"uuid":"67929487","full_name":"codebox/image_augmentor","owner":"codebox","description":"Data augmentation tool for images","archived":false,"fork":false,"pushed_at":"2023-10-03T21:37:59.000Z","size":17,"stargazers_count":454,"open_issues_count":6,"forks_count":156,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T06:33:35.634Z","etag":null,"topics":["data-augmentation","image-augmentor","machine-learning"],"latest_commit_sha":null,"homepage":"https://codebox.net/pages/image-augmentation-with-python","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-11T12:48:47.000Z","updated_at":"2025-03-31T13:42:37.000Z","dependencies_parsed_at":"2024-01-12T17:34:29.881Z","dependency_job_id":"555df563-b82f-4d89-92c7-93a7c5ea6519","html_url":"https://github.com/codebox/image_augmentor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codebox/image_augmentor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fimage_augmentor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fimage_augmentor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fimage_augmentor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fimage_augmentor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebox","download_url":"https://codeload.github.com/codebox/image_augmentor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fimage_augmentor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259462578,"owners_count":22861514,"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","image-augmentor","machine-learning"],"created_at":"2024-08-01T06:01:23.326Z","updated_at":"2025-06-12T12:13:33.980Z","avatar_url":"https://github.com/codebox.png","language":"Python","readme":"## Image Augmentor\n\nThis is a simple data augmentation tool for image files, intended for use with machine learning data sets.\nThe tool scans a directory containing image files, and generates new images by performing a specified set of\naugmentation operations on each file that it finds. This process multiplies the number of training examples that can\nbe used when developing a neural network, and should significantly improve the resulting network's performance,\nparticularly when the number of training examples is relatively small.\n\nRun the utility from the command-line as follows:\n\n    python main.py \u003cimage dir\u003e \u003ctransform1\u003e \u003ctransform2\u003e ...\n\nThe `\u003cimage dir\u003e` argument should be the path to a directory containing the image files to be augmented.\nThe utility will search the directory recursively for files with any of the following extensions:\n`jpg, jpeg, bmp, png`.\n\nThe `transform` arguments determine what types of augmentation operations will be performed,\nusing the codes listed in the table below:\n\n|Code|Description|Example Values|\n|---|---|------|\n|`fliph`|Horizontal Flip|`fliph`|\n|`flipv`|Vertical Flip|`flipv`|\n|`noise`|Adds random noise to the image|`noise_0.01`,`noise_0.5`|\n|`rot`|Rotates the image by the specified amount|`rot_90`,`rot_-45`|\n|`trans`|Shifts the pixels of the image by the specified amounts in the x and y directions|`trans_20_10`,`trans_-10_0`|\n|`zoom`|Zooms into the specified region of the image, performing stretching/shrinking as necessary|`zoom_0_0_20_20`,`zoom_-10_-20_10_10`|\n|`blur`|Blurs the image by the specified amount|`blur_1.5`|\n\n\nEach transform argument results in one additional output image being generated for each input image.\nAn argument may consist of one or more augmentation operations. Multiple operations within a single argument\nmust be separated by commas, and the order in which the operations are performed will match the order in which they\nare specified within the argument.\n\n### Examples\nProduce 2 output images for each input image, one of which is flipped horizontally, and one of which is flipped vertically:\n\n    python main.py ./my_images fliph flipv\n\nProduce 1 output image for each input image, by first rotating the image by 90\u0026deg; and then flipping it horizontally:\n\n    python main.py ./my_images rot_90,fliph\n\n### Operations\n\n#### Horizontal Flip\nMirrors the image around a vertical line running through its center\n\n    python main.py ./my_images fliph\n\n\u003cimg style=\"border: 1px solid grey\" style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__fliph.png\" alt=\"Flipped Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Vertical Flip\nMirrors the image around a horizontal line running through its center\n\n    python main.py ./my_images flipv\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__flipv.png\" alt=\"Flipped Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Noise\nAdds random noise to the image. The amount of noise to be added is specified by a floating-point numeric value that is included\nin the transform argument, the numeric value must be greater than 0.\n\n    python main.py ./my_images noise_0.01 noise_0.02 noise_0.05\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__noise0.01.png\" alt=\"Noisy Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__noise0.02.png\" alt=\"Noisy Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__noise0.05.png\" alt=\"Noisy Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Rotate\nRotates the image. The angle of rotation is specified by an integer value that is included in the transform argument\n\n    python main.py ./my_images rot_90 rot_180 rot_-90\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__rot90.png\" alt=\"Rotated Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__rot180.png\" alt=\"Rotated Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__rot-90.png\" alt=\"Rotated Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Translate\nPerforms a translation on the image. The size of the translation in the x and y directions are specified by integer values that\nare included in the transform argument\n\n    python main.py ./my_images trans_20_20 trans_0_100\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__trans20_20.png\" alt=\"Translated Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__trans0_100.png\" alt=\"Translated Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Zoom/Stretch\nZooms in (or out) to a particular area of the image. The top-left and bottom-right coordinates of the target region are\nspecified by integer values included in the transform argument. By specifying a target region with an aspect ratio that\ndiffers from that of the source image, stretching transformations can be performed.\n\n    python main.py ./my_images zoom_150_0_300_150 zoom_0_50_300_150 zoom_200_0_300_300\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__zoom150_0_300_150.png\" alt=\"Zoomed Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__zoom0_50_300_150.png\" alt=\"Stretched Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__zoom200_0_300_300.png\" alt=\"Stretched Image\" width=\"150\" height=\"150\"/\u003e\n\n#### Blur\nBlurs the image. The amount of blurring is specified by a floating-point value included in the transform argument.\n\n    python main.py ./my_images blur_1.0 blur_2.0 blur_4.0\n\n\u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw.png\" alt=\"Original Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__blur1.0.png\" alt=\"Blurred Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__blur2.0.png\" alt=\"Blurred Image\" width=\"150\" height=\"150\"/\u003e \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003cimg style=\"border: 1px solid grey\" src=\"http://codebox.net/assets/images/image-augmentation-with-python/macaw__blur4.0.png\" alt=\"Blurred Image\" width=\"150\" height=\"150\"/\u003e\n","funding_links":[],"categories":["Image Augmentation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fimage_augmentor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebox%2Fimage_augmentor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fimage_augmentor/lists"}