{"id":20703908,"url":"https://github.com/kalfasyan/plakakia","last_synced_at":"2025-10-28T05:04:57.839Z","repository":{"id":170099061,"uuid":"617078900","full_name":"kalfasyan/plakakia","owner":"kalfasyan","description":"Python image tiling library for image processing, object detection, etc.","archived":false,"fork":false,"pushed_at":"2024-07-25T10:54:42.000Z","size":3733,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T17:14:52.834Z","etag":null,"topics":["image-processing","image-tiling","object-detection"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kalfasyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-03-21T16:54:50.000Z","updated_at":"2024-10-26T18:47:42.000Z","dependencies_parsed_at":"2024-02-27T10:17:41.867Z","dependency_job_id":"ab247b69-3921-4220-bd13-a35aa04feda5","html_url":"https://github.com/kalfasyan/plakakia","commit_stats":null,"previous_names":["kalfasyan/plakakia"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalfasyan%2Fplakakia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalfasyan%2Fplakakia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalfasyan%2Fplakakia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalfasyan%2Fplakakia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kalfasyan","download_url":"https://codeload.github.com/kalfasyan/plakakia/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250347067,"owners_count":21415637,"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","image-tiling","object-detection"],"created_at":"2024-11-17T01:10:08.382Z","updated_at":"2025-10-28T05:04:52.806Z","avatar_url":"https://github.com/kalfasyan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Static Badge](https://badgen.net/github/release/kalfasyan/plakakia)\n![Static Badge](https://badgen.net/github/license/kalfasyan/plakakia)\n![Static Badge](https://badgen.net/github/stars/kalfasyan/plakakia)\n![Static Badge](https://badgen.net/github/open-issues/kalfasyan/plakakia)\n\n# plakakia \n### /πλακάκια  \n*Python image tiling library for image processing, object detection, etc.*\n    \n![Alt text](logo/logo.png?raw=true \"This is a \\\"plakaki\\\", meaning tile in Greek.\")  \n\n## What is this? What is it going to be?\n`plakakia` is an efficient image tiling tool designed to handle bounding boxes within images. It divides images into rectangular tiles based on specified parameters, seamlessly handling overlapping tiles. The tool assigns bounding boxes to tiles that fully contain them, and it also offers an option to eliminate duplicate bounding boxes. While the current version only supports fully contained bounding boxes, future updates will include support for partial overlap.  `plakakia` can handle object detection and segmentation datasets.  \n  \nCurrently, the library offers online and offline modes for processing data (refer to the [Usage section](https://github.com/kalfasyan/plakakia#usage) section below for more details):  \n\n- In the offline mode, one can use a config file and run a script once to process all data.\n- In the online mode, the `tile_image` function allows processing of images of any dimension.\n\nThere are plans to expand `plakakia`'s capabilities in the offline mode to handle images with more than 3 channels.\n  \n## Performance\nTo ensure optimal performance, `plakakia` utilizes the `multiprocessing` and `numpy` libraries. This enables efficient processing of thousands of images without the use of nested for-loops commonly used in tiling tasks. For detailed benchmarks on various public datasets, please refer to the information provided below.\n\n  \n# Installation\n\nIt is **highly** recommended that you create a new virtual environment for the installation:    \n 1. Download and install [Mamba](https://mamba.readthedocs.io/en/latest/installation.html) (or [Anaconda](https://www.anaconda.com/products/distribution)). \n 2. Create a virtual environment:  \n `mamba create -n plakakia jupyterlab nb_conda_kernels ipykernel ipywidgets pip -y`  \n 3. Activate the environment:  \n `mamba activate plakakia`\n4. Run the following command to install the library:  \n`pip install plakakia`  \n\n# Usage\n\n##### A. Offline tile generation with a config file\n    \n`make_tiles --config path/to/config.yaml`  \n\u003e Here's an [example config file](plakakia/config_example.yaml).  \n  \n##### B. Online tile generation\n  \n```\nfrom plakakia.utils_tiling import tile_image\n\ntiles, coordinates = tile_image(img, tile_size=100, step_size=100)\n```\n    \nFor more examples, check the [examples](examples/) folder.   \n    \n### Streamlit Demo App\nYou can run the demo app with the following command:\n```\nstreamlit run demo/explore_tiling_output.py\n```\nAnd when you open http://localhost:8501 in your browser, you should see the following:  \n  \n\u003cimg src=\"logo/tiles.png\" alt=\"drawing\" width=\"40%\"/\u003e\n\n# Benchmarks\n\n**Benchmarked on HP Laptop with specs**: AMD Ryzen 5 PRO 6650U; 6 cores; 12 threads; 2.9 GHz\n\n| Dataset | Source | Formats (images/labels) | Number of images | tile_size | step_size | tiles generated | plakakia performance |\n| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- |\n| Solar Panels v2  | [RoboFlow](https://universe.roboflow.com/roboflow-100/solar-panels-taxvb/dataset/2) | jpg/COCO | 112  | 150 | 50 | 3.075 | 1,11 sec | \n| Traffic Signs  | [Kaggle](https://www.kaggle.com/datasets/valentynsichkar/traffic-signs-dataset-in-yolo-format) | jpg/YOLO | 741  | 300 | 200 | 1.695 | 2,8 sec | \n| Hard Hat Workers v2  | [RoboFlow](https://public.roboflow.com/object-detection/hard-hat-workers/2) | jpg/YOLO | 5.269 | 100 | 50 | 21.678 | 6,94 sec| \n| Microsoft COCO dataset  | [RoboFlow](https://public.roboflow.com/object-detection/microsoft-coco-subset) | jpg/YOLO | 121.408 | 200 | 150 | 177.039 | 3 min 4 sec| \n\n# TODO list\n  \n ☑️ ~~Fix reading of classes from annotations (create a 'mapper' dictionary to map classes to numerical values).~~  \n ☑️ ~~Read settings from a file (e.g. json).~~  \n ☑️ ~~Removing all tiles with duplicate bounding boxes (that appear in other tiles).~~  \n ☑️ ~~Support other annotation formats (e.g. coco).~~ (only input for now)  \n ☑️ ~~Provide tiling functionality without any labels needed.~~  \n ☑️ ~~Add support for segmentation tasks (tile both input images and masks).~~  \n ☑️ ~~Add a demo app for the users to be able to see the tiling applied on an image.~~   \n ⬜️ Add less strict (flexible) duplicate removal methods to avoid missing bounding boxes.  \n ⬜️ Consider bounding boxes in tiles if they *partially* belong to one.  \n ⬜️ Support reading annotations from a dataframe/csv file.  \n ⬜️ Make tiles with multidimensional data offline with config file (e.g. hdf5 hyperspectral images).  \n   \n  \n# Want to contribute?\nIf you want to contribute to this project, please check the [CONTRIBUTING.md](CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalfasyan%2Fplakakia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkalfasyan%2Fplakakia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalfasyan%2Fplakakia/lists"}