Matplotlib Image labeller for classifying images

Overview

mpl-image-labeller

Binder Documentation Status

License PyPI Python Version

Use Matplotlib to label images for classification. Works anywhere Matplotlib does - from the notebook to a standalone gui!

For more see the documentation.

Install

pip install mpl-image-labeller

Key features

  • Simple interface
  • Uses keys instead of mouse
  • Only depends on Matplotlib
    • Works anywhere - from inside Jupyter to any supported GUI framework
  • Displays images with correct aspect ratio
  • Easily configurable keymap
  • Smart interactions with default Matplotlib keymap
  • Callback System (see examples/callbacks.py)

single class per image

gif of usage for labelling images of cats and dogs

multiple classes per image

gif of usage for labelling images of cats and dogs

Usage

import matplotlib.pyplot as plt
import numpy as np

from mpl_image_labeller import image_labeller

images = np.random.randn(5, 10, 10)
labeller = image_labeller(
    images, classes=["good", "bad", "meh"], label_keymap=["a", "s", "d"]
)
plt.show()

accessing the axis You can further modify the image (e.g. add masks over them) by using the plotting methods on axis object accessible by labeller.ax.

Lazy Loading Images If you want to lazy load your images you can provide a function to give the images. This function should take the integer idx as an argument and return the image that corresponds to that index. If you do this then you must 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.

Controls

  • <- move one image back
  • -> move one image forward

To label images use the keys defined in the label_keymap argument - default 0, 1, 2...

Get the labels by accessing the labels property.

Overwriting default keymap

Matplotlib 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.

Related Projects

This is not the first project to implement easy image labelling but seems to be the first to do so entirely in Matplotlib. The below projects implement varying degrees of complexity and/or additional features in different frameworks.

You might also like...
This repository contains several image-to-image translation models, whcih were tested for RGB to NIR image generation. The models are Pix2Pix, Pix2PixHD, CycleGAN and PointWise.

RGB2NIR_Experimental This repository contains several image-to-image translation models, whcih were tested for RGB to NIR image generation. The models

Official implement of Paper:A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sening  images
Official implement of Paper:A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sening images

A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sensing images 深度监督影像融合网络DSIFN用于高分辨率双时相遥感影像变化检测 Of

The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.
The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.

Object-Placement-Assessment-Dataset-OPA Object-Placement-Assessment (OPA) is to verify whether a composite image is plausible in terms of the object p

For auto aligning, cropping, and scaling HR and LR images for training image based neural networks

ImgAlign For auto aligning, cropping, and scaling HR and LR images for training image based neural networks Usage Make sure OpenCV is installed, 'pip

Rename Images with Auto Generated Neural Image Captions

Recaption Images with Generated Neural Image Caption Example Usage: Commandline: Recaption all images from folder /home/feng/Downloads/images to folde

A python-image-classification web application project, written in Python and served through the Flask Microframework. This Project implements the VGG16 covolutional neural network, through Keras and Tensorflow wrappers, to make predictions on uploaded images.
Image-to-Image Translation with Conditional Adversarial Networks (Pix2pix) implementation in keras

pix2pix-keras Pix2pix implementation in keras. Original paper: Image-to-Image Translation with Conditional Adversarial Networks (pix2pix) Paper Author

Learning Continuous Image Representation with Local Implicit Image Function
Learning Continuous Image Representation with Local Implicit Image Function

LIIF This repository contains the official implementation for LIIF introduced in the following paper: Learning Continuous Image Representation with Lo

Comments
Releases(1.1.2)
  • 1.1.2(Nov 18, 2022)

  • 1.1.1(Nov 12, 2021)

    What's Changed

    • add github actions test by @ianhi in https://github.com/ianhi/mpl-image-labeller/pull/20
    • Autoscale cmaps + add tests by @ianhi in https://github.com/ianhi/mpl-image-labeller/pull/21
    • Updated callbacks example to show how to adjust overlay extent

    Full Changelog: https://github.com/ianhi/mpl-image-labeller/compare/1.1.0...1.1.1

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Nov 1, 2021)

    What's Changed

    • Added ability for user to set the title https://github.com/ianhi/mpl-image-labeller/pull/15
    • Updated text positioning for single class labeller

    Full Changelog: https://github.com/ianhi/mpl-image-labeller/compare/1.0.0...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Oct 30, 2021)

  • 0.5.0(Oct 29, 2021)

    • Fixed xlims getting messed up when zooming in https://github.com/ianhi/mpl-image-labeller/pull/9
    • Allow passing imshow_kwargs https://github.com/ianhi/mpl-image-labeller/commit/27afa0bf9633c5f59e2d3089f9fef789147e2b3c
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Oct 29, 2021)

  • 0.3.0(Oct 27, 2021)

  • 0.2.0(Oct 27, 2021)

    Full Changelog: https://github.com/ianhi/mpl-image-labeller/compare/0.1.1...0.2.0

    Fixes:

    init_labels is respected

    new features:

    1. ax is not accesible through the .ax attribute
    2. images can now be a callable

    Thanks to @jrussell25 for suggesting these improvements

    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Oct 27, 2021)

Owner
Ian Hunt-Isaak
The embodiment of entropy - He/Him
Ian Hunt-Isaak
Classifying audio using Wavelet transform and deep learning

Audio Classification using Wavelet Transform and Deep Learning A step-by-step tutorial to classify audio signals using continuous wavelet transform (C

Aditya Dutt 17 Nov 29, 2022
Rafael Project- Classifying rockets to different types using data science algorithms.

Rocket-Classify Rafael Project- Classifying rockets to different types using data science algorithms. In this project we received data base with data

Hadassah Engel 5 Sep 18, 2021
An implementation of quantum convolutional neural network with MindQuantum. Huawei, classifying MNIST dataset

关于实现的一点说明 山东大学 2020级 苏博南 www.subonan.com 文件说明 tools.py 这里面主要有两个函数: resize(a, lenb) 这其实是我找同学写的一个小算法hhh。给出一个$28\times 28$的方阵a,返回一个$lenb\times lenb$的方阵。因

ぼっけなす 2 Aug 29, 2022
Sdf sparse conv - Deep Learning on SDF for Classifying Brain Biomarkers

Deep Learning on SDF for Classifying Brain Biomarkers To reproduce the results f

null 1 Jan 25, 2022
A series of convenience functions to make basic image processing operations such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and Python.

imutils A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, and displ

Adrian Rosebrock 4.3k Jan 8, 2023
Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of images as "pixels"

picinpics Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of

RodrigoCMoraes 1 Oct 24, 2021
Img-process-manual - Utilize Python Numpy and Matplotlib to realize OpenCV baisc image processing function

Img-process-manual - Opencv Library basic graphic processing algorithm coding reproduction based on Numpy and Matplotlib library

Jack_Shaw 2 Dec 12, 2022
Crab is a flexible, fast recommender engine for Python that integrates classic information filtering recommendation algorithms in the world of scientific Python packages (numpy, scipy, matplotlib).

Crab - A Recommendation Engine library for Python Crab is a flexible, fast recommender engine for Python that integrates classic information filtering r

python-recsys 1.2k Dec 21, 2022
Numerical Methods with Python, Numpy and Matplotlib

Numerical Bric-a-Brac Collections of numerical techniques with Python and standard computational packages (Numpy, SciPy, Numba, Matplotlib ...). Diffe

Vincent Bonnet 10 Dec 20, 2021
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022