{"id":20489913,"url":"https://github.com/fuzailpalnak/ttaugment","last_synced_at":"2026-04-28T15:41:28.506Z","repository":{"id":56014095,"uuid":"287739412","full_name":"fuzailpalnak/ttAugment","owner":"fuzailpalnak","description":"Test Time Augmentation for Deep Learning Inference","archived":false,"fork":false,"pushed_at":"2023-06-05T12:39:03.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T01:46:48.765Z","etag":null,"topics":["augmentation","computer-vision","deep-learning","inference","segmentation","segmentation-models","test-time-augmentation","tta"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuzailpalnak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"fuzailpalnak","patreon":null,"open_collective":null,"ko_fi":"fuzailpalnak","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-08-15T12:08:55.000Z","updated_at":"2022-09-30T09:19:26.000Z","dependencies_parsed_at":"2025-06-22T01:38:33.848Z","dependency_job_id":"e8a12071-aed7-4715-a75b-c138955a4f5c","html_url":"https://github.com/fuzailpalnak/ttAugment","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fuzailpalnak/ttAugment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuzailpalnak%2FttAugment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuzailpalnak%2FttAugment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuzailpalnak%2FttAugment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuzailpalnak%2FttAugment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuzailpalnak","download_url":"https://codeload.github.com/fuzailpalnak/ttAugment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuzailpalnak%2FttAugment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32387920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["augmentation","computer-vision","deep-learning","inference","segmentation","segmentation-models","test-time-augmentation","tta"],"created_at":"2024-11-15T17:14:45.693Z","updated_at":"2026-04-28T15:41:28.485Z","avatar_url":"https://github.com/fuzailpalnak.png","language":"Python","funding_links":["https://github.com/sponsors/fuzailpalnak","https://ko-fi.com/fuzailpalnak"],"categories":[],"sub_categories":[],"readme":"# TTAugment\n![GitHub](https://img.shields.io/github/license/cypherics/TTAugment)\n![Python](https://img.shields.io/badge/python-v3.6+-blue.svg)\n![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)\n![Downloads](https://pepy.tech/badge/ttaugment)\n\nPerform Augmentation during Inference and aggregate the results of all the applied augmentation to create a\nfinal output\n\n## Installation\n\n    pip install ttAugment\n\n\n## Supported Augmentation\nLibrary supports all [color](https://imgaug.readthedocs.io/en/latest/source/api_augmenters_color.html), \n[blur](https://imgaug.readthedocs.io/en/latest/source/api_augmenters_blur.html) and [contrast](https://imgaug.readthedocs.io/en/latest/source/api_augmenters_contrast.html)\ntransformation provided by [imgaug](https://imgaug.readthedocs.io/en/latest/) along with custom Geometric Transformation.\n\n1. Mirror : Crop an image to `crop_to_dimension` and mirror pixels to match the size of `window_dimension`\n2. CropScale : Crop an image to `crop_to_dimension` and rescale the image to match the size of `window_dimension`\n3. NoAugment : Keep the input unchanged\n4. Crop : Crop an image to `crop_to_dimension`\n5. Rot : Rotate an Image\n6. FlipHorizontal\n7. FlipVertical \n\n## Usage\n\nHow to use when test image is much **larger** than what the model requires, Don't worry the library has it covered,\nit will generate fragments according to the specified dimension, so the inference can be performed while applying augmentation.\n\n- window_size: Break the image into smaller images of said size \n- output_dimension: It must be greater the input image in order for the fragments to be restored back on the \nimage.\n\n```python\nimport numpy as np\nfrom tt_augment.augment import generate_seg_augmenters\n\ntransformation_to_apply = [\n  {\"name\": \"Mirror\", \"crop_to_dimension\": (256, 256)},\n  {\"name\": \"CropScale\", \"crop_to_dimension\": (256, 256)},\n]\n\nfor i in range(0, 10):\n  image = np.random.rand(512, 512, 3) * 255\n  image = np.expand_dims(image, 0)\n\n  # Load augmentation object for the image, this includes to break the image in smaller fragments.\n  tta = generate_seg_augmenters(\n    image=image,\n    window_size=(384, 384),\n    output_dimension=(1, 512, 512, 3),\n    transformation_to_apply=transformation_to_apply,\n  )\n\n  # Iterate over transformation_to_apply\n  for iterator, transformation in enumerate(tta):\n    # Iterate over individual fragments\n    for augmented_fragment in transformation.transform_fragment():\n      #     ---\u003e transformed_fragment.shape = (1, 384, 384, 3) \n      # Inference steps for augmented fragment\n      # 1. perform image normalization\n      #     ---\u003e normalised_image = image_normalization(augmented_fragment)\n      # 2. perform model prediction\n      #     ---\u003e prediction = model.predict(normalised_image)\n      # 3. convert prediction to numpy with shape [batch, h, w, channel]\n      # 4. place the prediction fragment on its position in the original image\n      #     ---\u003e transformation.restore_fragment(prediction)\n\n      transformation.restore_fragment(augmented_fragment)\n\n  # Aggregate the result for the input image over all applied augmentations\n  tta.merge()\n\n  output = tta.tta_output()\n```\n## Example Implementation\n\n[Library used for Predicting Building footprint](https://github.com/fuzailpalnak/building-footprint-segmentation/blob/main/examples/PredictionWithAugmentations.ipynb)\n\n\n    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuzailpalnak%2Fttaugment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuzailpalnak%2Fttaugment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuzailpalnak%2Fttaugment/lists"}