{"id":13771053,"url":"https://github.com/LukasBommes/Grid-Annotation-Tool","last_synced_at":"2025-05-11T03:33:06.150Z","repository":{"id":148487812,"uuid":"400563516","full_name":"LukasBommes/Grid-Annotation-Tool","owner":"LukasBommes","description":"Annotation Tool for Instance Segmentation of Grid Structures (deprecated in favour of Grid Annotation Tool 2)","archived":false,"fork":false,"pushed_at":"2022-07-06T14:58:23.000Z","size":12568,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T01:34:35.694Z","etag":null,"topics":["annotation","computer-vision","dataset","deep-learning","grid","instance-segmentation","labelling","mask-rcnn","webapp"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/LukasBommes.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":"2021-08-27T15:59:32.000Z","updated_at":"2024-07-15T02:32:41.000Z","dependencies_parsed_at":"2023-06-04T01:45:51.854Z","dependency_job_id":null,"html_url":"https://github.com/LukasBommes/Grid-Annotation-Tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBommes%2FGrid-Annotation-Tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBommes%2FGrid-Annotation-Tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBommes%2FGrid-Annotation-Tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBommes%2FGrid-Annotation-Tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukasBommes","download_url":"https://codeload.github.com/LukasBommes/Grid-Annotation-Tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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":["annotation","computer-vision","dataset","deep-learning","grid","instance-segmentation","labelling","mask-rcnn","webapp"],"created_at":"2024-08-03T17:00:46.998Z","updated_at":"2025-05-11T03:33:01.123Z","avatar_url":"https://github.com/LukasBommes.png","language":"HTML","funding_links":[],"categories":["Image / video"],"sub_categories":["Open source"],"readme":"# Grid Annotation Tool\r\n\r\nNews: This project has been deprecated in favour of [Grid Annotation Tool 2](https://github.com/LukasBommes/Grid-Anotation-Tool-2).\r\n\r\nA tool for annotating grid structures in images for computer vision research and applications. For some applications you may want to annotate a grid structure to train, for example, an instance segmentation model, such as Mask R-CNN.\r\n\r\nDifferent from existing annotation tools you do not have to draw a bounding box for each cell in your grid. Instead, you annotate the intersection lines, which is faster and yields cleaner co-linear edges. To account for lens distortion you can annotate both lines and curves.\r\n\r\n![screenshot of grid annotation tool](screenshot.png)\r\n\r\nWe initially developed this tool for annotating instance segmentation masks of photovoltaics modules, but it may be useful for other applications.\r\n\r\n### Examples\r\n\r\n![first example](example1.png)\r\n\r\n![first example](example2.png)\r\n\r\n![first example](example3.png)\r\n\r\n![first example](example4.png)\r\n\r\n![first example](example5.png)\r\n\r\n\r\n### Installation\r\n\r\nThis project requires Python 3, [Flask](https://pypi.org/project/Flask/) and [Flask-WTF](https://pypi.org/project/Flask-WTF/).\r\n\r\n\r\n### Quickstart\r\n\r\n1. Open a terminal in the project root and run `python annotation_tool.py`\r\n2. Navigate to 127.0.0.1:5000 in your web browser\r\n\r\nYou should now see the annotation app and a list of example images in the left sidebar. You can click on one of the images and begin annotation.\r\n\r\n\r\n### Annotating your own images\r\n\r\n1. Rename your images with random UUID4 (e.g. with Python's UUID library)\r\n2. Place your images in `static/uploads`\r\n3. Start the annotation tool as explained above\r\n\r\n\r\n### Annotating a Grid\r\n\r\n1. Select an image in the left sidebar by clicking on one of the image IDs\r\n2. Draw auxiliary lines / auxiliary curves by clicking on \"Draw Auxiliary Line\" / \"Draw Auxiliary Curve\" and placing two / three points by clicking into the image. These lines should outline the grid lines between individual grid cells.\r\n3. Click on \"Get Intersections\" to compute the intersection points between auxiliary lines and curves.\r\n4. You can optionally add intersection points manually by clicking \"Add corners\" and placing them in the image by clicking.\r\n5. Click on \"Create Grid Cell\" to indicate which corners belong to a grid cell. When hovering over the image four dashed lines will connect your cursor to four corner points. Move the cursor roughly in the center of the grid cell and click. A new grid cell is being placed.\r\n6. If automatic selection of corner points is not possible, click \"Create Grid Cell (manual)\" and select the four corners of a grid cell by clicking.\r\n7. If you want to handle truncated (i.e. partially visible) grid cells differently in your application, you can click the \"Toggle Cell Visibility\" button. Now, you can click on grid cells and mark them as truncated. A truncated grid cell will be rendered in yellow.\r\n\r\nTo erase items, such as corners or auxiliary lines, click the \"Erase\" button and click the item you want to delete in the image. When you erase a corner all associated grid cells will be removed.\r\n\r\nYou can drag auxiliary lines or corners in the image by clicking an dragging.\r\n\r\n\r\n### Annotation File Format\r\n\r\nTo save the annotation simply go to the next image by selecting it in the left sidebar. The annotation is saved in a separate JSON file for each image under `static/annotations`. The file name corresponds to the image UUID. Another json file is placed under `static/save`, which is for internal use only.\r\n\r\nThe annotation file format is as follows, i.e. each image has a list of grid cells, each with four corner points, one center point, its own UUID and a boolean flag indicating whether the grid cell is truncated.\r\n```\r\n{\r\n  \"image\": \"0a002eb1-8d2c-4d23-8a25-65a34d1f2673.jpg\",\r\n  \"grid_cells\": [\r\n    {\r\n      \"corners\": [\r\n        {\"x\": 181.98136043148975, \"y\": 180.87500292991302},\r\n        {\"x\": 80.99062551749896, \"y\": 176.94569670353974},\r\n        {\"x\": 78.42819076221744, \"y\": 294.24826550087346},\r\n        {\"x\": 183.0432587489509, \"y\": 294.49812289825013}\r\n      ],\r\n      \"center\": {\"x\": 131.1108588650393, \"y\": 236.64177200814407},\r\n      \"id\": \"0d9307ac-0a57-48e9-897f-8d782e844509\",\r\n      \"truncated\": true\r\n    },\r\n    ...\r\n  ]\r\n}\r\n```\r\n\r\n### Known Bugs\r\n\r\nThe grid annotation tool relies on the [2D.js](http://www.kevlindev.com/geometry/2D/intersections/index.htm) library for calculating intersection points between auxiliary lines. It has a known bug, which causes it to miss some intersections between pairs of curves. In this case, please add the missed intersections manually by first clicking \"Add Corners\" and then clicking on the image.\r\n\r\n### About\r\n\r\nThis software is written by **Lukas Bommes, M.Sc.** - [Helmholtz Institute Erlangen-Nürnberg for Renewable Energy](https://www.hi-ern.de/hi-ern/EN/home.html)\r\n\r\n\r\n#### License\r\n\r\nThis project is licensed under the MIT license - see the [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasBommes%2FGrid-Annotation-Tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLukasBommes%2FGrid-Annotation-Tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasBommes%2FGrid-Annotation-Tool/lists"}