{"id":19534772,"url":"https://github.com/berecat/image-tiler","last_synced_at":"2025-07-12T07:33:24.392Z","repository":{"id":167023524,"uuid":"527857447","full_name":"berecat/image-tiler","owner":"berecat","description":"A useful tool for dividing high-resolution images into 𝑚 × 𝑛 tiles while retaining their annotations, including polygons and bounding boxes.","archived":false,"fork":false,"pushed_at":"2023-09-08T02:10:57.000Z","size":6802,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T16:28:11.755Z","etag":null,"topics":["image-processing","object-detection","python"],"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/berecat.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":"2022-08-23T06:15:59.000Z","updated_at":"2024-10-25T17:25:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f387055-9afe-45d7-94f2-afb6917872c5","html_url":"https://github.com/berecat/image-tiler","commit_stats":null,"previous_names":["dreemhai/pushetta-api-django","berecat/image-tiler"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/berecat/image-tiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berecat%2Fimage-tiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berecat%2Fimage-tiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berecat%2Fimage-tiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berecat%2Fimage-tiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berecat","download_url":"https://codeload.github.com/berecat/image-tiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berecat%2Fimage-tiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958188,"owners_count":23689010,"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":["image-processing","object-detection","python"],"created_at":"2024-11-11T02:15:32.464Z","updated_at":"2025-07-12T07:33:24.368Z","avatar_url":"https://github.com/berecat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageTiler\nThis project aims to develop an image tiling system that can divide high-resolution images into 𝑚 × 𝑛 tiles while preserving their annotations, including polygons and bounding boxes. Image tiling is an important technique for object detection and segmentation in computer vision. By dividing large images into smaller tiles, this technique can improve the accuracy and efficiency of object detection, particularly for detecting small objects in high-resolution images.\n\nThe system will be designed to support different input image formats and annotation types. The user can specify the size of the tiles and the overlap between them. The system will then automatically generate the tiled images and preserve the original annotations in each tile. The annotations will be adjusted to account for the relative position of the tile within the original image.\n\nThe system will be particularly useful for segmentation algorithms that require fixed picture sizes. By preserving the annotations in each tile, the system will help to maintain the accuracy of the segmentation. Moreover, the system will allow users to preserve important details in high-resolution images that might be lost when using other image processing techniques.\n\n# Features\n* Three different tiling methods: default, overlapping, and padding\n* Support for annotations such as polygons and bounding boxes\n* Support building tiles from image paths, bytes, and files on MinIO Object Storage\n\n\n# Getting Started\n\n## Installing\n\n1. Clone the repository\n```bash\ngit clone https://github.com/hossshakiba/ImageTiler.git\n```\n2. Install dependencies\n```bash\npip install -r requirements.txt\n```\n\n## Usage\nHere is a sample code of using ImageTiler:\n\u003e Note: Annotations must be in COCO format\n```python\n# read image annotations (polygons or bounding boxes)\nwith open('annotations.json', 'r') as file:\n    polygons = json.loads(file.read())\n\n# create ImageTilingFactory object with desired tiling parameters\nobj = ImageTilingFactory(\n    polygons=polygons,\n    tile_width=650,\n    tile_height=650,\n    tiling_type=\"overlapping\"\n)\n\n# build the tiles\nobj.build_tiles_from_file('images/pandas.jpg')\n\n# draw new annotations on tiles and save them\nfor image, annotation in zip(obj.tiled_image_files, obj.tiled_annotations):\n    image_file, image_file_name = image[0], image[1]\n    visualize_keypoints(image_file, annotation, f'overlapping_tiles/{image_file_name}')\n```\n\n## Results\nThe results of the project are organized into different folders, each containing the results of a specific tiling method:\n* default\n* overlapping\n* padding\n\nThe following annotated image is divided into tiles with different methods:\n\u003cp class=\"row\" float=\"left\" align=\"middle\"\u003e\n  \u003cimg style=\"width: 100%; height: auto;\" src=\"/images/pandas.png\" title=\"confusion matrix\"/\u003e\n\u003c/p\u003e\nHere are four samples of generated 650 × 650 tiles with overlapping method:\u003cbr\u003e\u003cbr\u003e\n\u003cp class=\"row\" align=\"middle\"\u003e\n  \u003cimg src=\"/overlapping_tiles/tiled_pandas_0_350---650_1000.jpg\" width=\"200\" height=\"200\" /\u003e \n  \u003cimg src=\"/overlapping_tiles/tiled_pandas_650_0---1300_650.jpg\" width=\"200\" height=\"200\" /\u003e\n  \u003cimg src=\"/overlapping_tiles/tiled_pandas_850_0---1500_650.jpg\" width=\"200\" height=\"200\" /\u003e\n  \u003cimg src=\"/overlapping_tiles/tiled_pandas_850_350---1500_1000.jpg\" width=\"200\" height=\"200\"/\u003e\n\u003c/p\u003e\n\n# Conclusion\nThe results of the ImageTiler project show that the tool is effective at preserving annotations in the resulting tiles, even for small objects in high-resolution images. The evaluation results demonstrate that the tool can support object detection in high-resolution images. Though trying different methods and tiling sizes based on your images is always suggested to get the best result.\n\n# Future Work\n- Sometimes there are some issues with generating new annotations, especially when the original ones are overlapped. These exceptions are ignored now and do not intercept the tiling process. They should get handled in a better way.\n- New tiling methods can be added to the project.\n# Contributing\nIf you are interested in contributing to the project, please follow these steps:\n1. Fork the repository\n2. Create a new branch for your changes\n3. Commit your changes and open a pull request\n\n# License\nThis project is licensed under the MIT license.\n\n# Acknowledgments\n- The Shapely package had a crucial role in implementing this project.\n- Thank you in advance to all contributors for their time and effort in improving this project. Thank you! :heart:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberecat%2Fimage-tiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberecat%2Fimage-tiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberecat%2Fimage-tiler/lists"}