{"id":24366992,"url":"https://github.com/davide710/augmentation","last_synced_at":"2026-04-10T23:06:21.263Z","repository":{"id":220705737,"uuid":"751463218","full_name":"davide710/augmentation","owner":"davide710","description":"Twice the dataset, same the time for annotation!","archived":false,"fork":false,"pushed_at":"2025-01-16T17:23:33.000Z","size":1899,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T18:44:05.081Z","etag":null,"topics":["computer-vision","dataannotations","datalabeling","linear-algebra","machine-learning","math","object-detection","opencv","python","yolo"],"latest_commit_sha":null,"homepage":"","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/davide710.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-01T16:57:43.000Z","updated_at":"2025-01-16T17:23:35.000Z","dependencies_parsed_at":"2024-03-19T17:31:04.223Z","dependency_job_id":"a95c7250-d61e-4dac-8e02-da20f94f78d7","html_url":"https://github.com/davide710/augmentation","commit_stats":null,"previous_names":["davide710/augment-it","davide710/augmentation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davide710%2Faugmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davide710%2Faugmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davide710%2Faugmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davide710%2Faugmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davide710","download_url":"https://codeload.github.com/davide710/augmentation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196654,"owners_count":20251861,"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":["computer-vision","dataannotations","datalabeling","linear-algebra","machine-learning","math","object-detection","opencv","python","yolo"],"created_at":"2025-01-19T01:11:43.462Z","updated_at":"2025-12-27T00:43:56.521Z","avatar_url":"https://github.com/davide710.png","language":"Python","readme":"# augmentation\n\nTwice the dataset, _same_ the time for annotation!\n\nMultiply the size of the dataset (rotations, changes in brightness and contrast) in no time and don't waste another instant annotating it.\n\n### Why?\n\nData augmentation is fundamental for a good object detection model. The problem is, the most boring part of object detection is annotating the dataset \n(e.g. using https://pypi.org/project/labelImg/ for YOLO model), and having to do it multiple times because for slightly different images feels like\nsomething that should be done automatically. And so it is (from now on)!\n\n### How?\n\nPut your annotated images in a directory with the annotation (.txt) files. The code assumes that for the image \"my_image.jpg\" there is the file \"my_image.txt\", structured as follows: `class_id center_x center_y bounding_box_width bounding_box_height` (see examples in [resources/](resources/)), where `center_x` and `bounding_bow_width` are normalized to the image width and `center_y`, `bounding_box_height` to the image height.\nNow:\n```\ngit clone https://github.com/davide710/augment-it.git\ncd augment-it\npip install numpy opencv-contrib-python\n```\nYou can see a demo of how the code works by running `python3 demo.py`. This shows how the images (data I used for an actual object detection model) are rotated and how the bounding box automatically follows the object thanks to the magic of linear algebra. \n\n![original image](https://github.com/davide710/augment-it/assets/106482229/8c8181ff-c703-4a01-9911-e1048ef7e922)\n![rotated image and box](https://github.com/davide710/augment-it/assets/106482229/9c50211b-3b6e-418f-a31e-e33bf6596cf6)\n\nTo use the functions in your code, simply\n```\nfrom rotation import rotate\nfrom brightness_contrast import change_brightness_contrast\n\nrotate(file_list, min_angle=5, max_angle=355, make_annotations=True, rotate_bbox=False, debug=False)\nchange_brightness_contrast(file_list, min_alpha=0.5, max_alpha=1.5, min_beta=-60, max_beta=60, make_annotations=True)\n```\n+ use `rotate_bbox=False` if your objects are circular (hence you just need to rotate the center)\n+ use `make_annotations=False` if you just want the new images but not the new annotation files\n+ `rotate` will save the output files in the directory \"rotated/\" and add \"_rot\" to all file names\n+ `change_brightness_contrast` will save the output files in the directory \"br_and_con/\" and add \"_bc\" to all file names\n\n#\n#  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavide710%2Faugmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavide710%2Faugmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavide710%2Faugmentation/lists"}