{"id":19870400,"url":"https://github.com/mpl-extensions/mpl-image-labeller","last_synced_at":"2025-05-02T08:31:51.967Z","repository":{"id":46119609,"uuid":"421914430","full_name":"mpl-extensions/mpl-image-labeller","owner":"mpl-extensions","description":"Matplotlib Image labeller for classifying images","archived":false,"fork":false,"pushed_at":"2025-01-06T18:33:02.000Z","size":2901,"stargazers_count":10,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T00:14:05.690Z","etag":null,"topics":["human-in-the-loop","human-in-the-loop-machine-learning","image-classification","image-labeling","image-labeling-tool","image-labelling-tool","labeling-tool","matplotlib","python"],"latest_commit_sha":null,"homepage":"http://mpl-image-labeller.rtfd.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpl-extensions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/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}},"created_at":"2021-10-27T17:33:37.000Z","updated_at":"2024-06-24T15:47:13.000Z","dependencies_parsed_at":"2023-10-03T03:47:59.970Z","dependency_job_id":"57be6292-4a0a-474c-8395-a1b690c6689a","html_url":"https://github.com/mpl-extensions/mpl-image-labeller","commit_stats":null,"previous_names":["mpl-extensions/mpl-image-labeller","ianhi/mpl-image-labeller"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl-extensions%2Fmpl-image-labeller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl-extensions%2Fmpl-image-labeller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl-extensions%2Fmpl-image-labeller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl-extensions%2Fmpl-image-labeller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpl-extensions","download_url":"https://codeload.github.com/mpl-extensions/mpl-image-labeller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252008861,"owners_count":21679651,"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":["human-in-the-loop","human-in-the-loop-machine-learning","image-classification","image-labeling","image-labeling-tool","image-labelling-tool","labeling-tool","matplotlib","python"],"created_at":"2024-11-12T16:08:47.391Z","updated_at":"2025-05-02T08:31:47.579Z","avatar_url":"https://github.com/mpl-extensions.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mpl-image-labeller\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ianhi/mpl-image-labeller/main?urlpath=lab/tree/docs/examples)\n[![Documentation Status](https://readthedocs.org/projects/mpl-image-labeller/badge/?version=stable)](https://mpl-image-labeller.readthedocs.io/en/stable/?badge=stable)\n\n\n[![License](https://img.shields.io/pypi/l/mpl-image-labeller.svg?color=green)](https://github.com/ianhi/mpl-image-labeller/raw/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/mpl-image-labeller.svg?color=green)](https://pypi.org/project/mpl-image-labeller)\n[![Python Version](https://img.shields.io/pypi/pyversions/mpl-image-labeller.svg?color=green)](https://python.org)\n\nUse Matplotlib to label images for classification. Works anywhere Matplotlib does - from the notebook to a standalone gui!\n\nFor more see the [documentation](https://mpl-image-labeller.readthedocs.io/en/stable/?badge=stable).\n\n## Install\n\n```bash\npip install mpl-image-labeller\n```\n## Key features\n- Simple interface\n- Uses keys instead of mouse\n- Only depends on Matplotlib\n    - Works anywhere - from inside Jupyter to any supported GUI framework\n- Displays images with correct aspect ratio\n- Easily configurable keymap\n- Smart interactions with default Matplotlib keymap\n- Callback System (see `examples/callbacks.py`)\n\n**single class per image**\n\n![gif of usage for labelling images of cats and dogs](docs/_static/single_class.gif)\n\n**multiple classes per image**\n\n![gif of usage for labelling images of cats and dogs](docs/_static/multi_class.gif)\n\n## Usage\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom mpl_image_labeller import image_labeller\n\nimages = np.random.randn(5, 10, 10)\nlabeller = image_labeller(\n    images, classes=[\"good\", \"bad\", \"meh\"], label_keymap=[\"a\", \"s\", \"d\"]\n)\nplt.show()\n```\n\n**accessing the axis**\nYou can further modify the image (e.g. add masks over them) by using the plotting methods on\naxis object accessible by `labeller.ax`.\n\n**Lazy Loading Images**\nIf you want to lazy load your images you can provide a function to give the images. This function should take\nthe integer `idx` as an argument and return the image that corresponds to that index. If you do this then you\nmust also provide `N_images` in the constructor to let the object know how many images it should expect. See `examples/lazy_loading.py` for an example.\n\n### Controls\n\n- `\u003c-` move one image back\n- `-\u003e` move one image forward\n\nTo label images use the keys defined in the `label_keymap` argument - default 0, 1, 2...\n\n\nGet the labels by accessing the `labels` property.\n\n### Overwriting default keymap\nMatplotlib has default keybindings that it applied to all figures via `rcparams.keymap` that allow for actions such as `s` to save or `q` to quit. If you inlcude one of these keys as a shortcut for labelling as a class then that default keymap will be disabled for that figure.\n\n\n## Related Projects\n\nThis is not the first project to implement easy image labelling but seems to be the first to do so entirely in Matplotlib. The below\nprojects implement varying degrees of complexity and/or additional features in different frameworks.\n\n- https://github.com/wbwvos/pidgey\n- https://github.com/agermanidis/pigeon\n- https://github.com/Serhiy-Shekhovtsov/tkteach\n- https://github.com/robertbrada/PyQt-image-annotation-tool\n- https://github.com/Cartucho/OpenLabeling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpl-extensions%2Fmpl-image-labeller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpl-extensions%2Fmpl-image-labeller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpl-extensions%2Fmpl-image-labeller/lists"}