Skip to main content

Simple tool to manually label images in disctinct categories to build training datasets.

Project description

Simplabel

PyPI version

Graphical tool to manually label images in distinct categories to build training datasets. Simply pass a list of categories, a directory containing images and start labelling. Supports multiple users, reconciliation and keyboard bindings to label even faster!

screenshot

Installation

Install with pip

Simplabel is on PyPI so it can be installed with pip

pip install simplabel

Install from source

Clone the repository to your computer

git clone https://github.com/hlgirard/Simplabel.git

and install with pip

cd Simplabel
pip install .

Usage

Quick start

Pass the labels and image directory on the command line to start labelling. Use the on-screen buttons to select a label for the current image and advance to the next one. Number keys correspond to labels and can be used instead.

simplabel --labels dog cat bird --directory path/to/image/directory

After the first use, labels are stored in labels.pkl and the --labels argument is ignored.

Command line arguments

  • -d, --directory <PATH/TO/DIRECTORY> sets the directory to search for images and save labels to. Defaults to the current working directory.
  • -l, --labels <label1 label2 label3 ...> sets the categories for the labelling task. Only passed on the first use in a given directory.
  • -u, --user <USERNAME> sets the username. Defaults to the OS login name if none is passed.
  • -r, --redundant does not display other labelers selections for independent labelling. Reconciliation and Make Master are unavailable in this mode.
  • -v, --verbose increases the verbosity level.
  • --remove-label tries to safely remove a label from the list saved in labels.pkl.
  • --reset-lock overrides the lock preventing the same username from being used multiple times simultaneously.
  • --delete-all removes all files created by simplabel in the directory

Multiuser

The app relies on the filesystem to save each user's selection and display other user's selections. It works best if the working directory is on a shared drive or in a synced folder (Dropbox, Onedrive...). The Reconcile workflow allows any user to see and resolve conflicts. The Make Master option can be used to create and save a master dictionary - labeled_master.pkl - containing all labeled images (after reconciliation).

Import saved labels

The app saves a labeled_<username>.pkl file that contains a pickeled dictionary {image_name: label}. To import the dictionary, use the following sample code:

import pickle

with open("labeled_user1.pkl","rb") as f:
    label_dict = pickle.load(f)

Advanced usage

Utilities

Once you are done labelling, use the flow_to_directory tool to copy images to distinct directories by label

flow_to_directory --rawDirectory data/raw --outDirectory data/labeled

Python object

The Tkinter app can also be started from a python environment

from simplabel import ImageClassifier
import tkinter as tk

root = tk.Tk() 
directory = "data/raw"
categories = ['dog', 'cat', 'bird']
MyApp = ImageClassifier(root, directory, categories)
tk.mainloop()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplabel-0.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplabel-0.1.1-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file simplabel-0.1.1.tar.gz.

File metadata

  • Download URL: simplabel-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for simplabel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f14d8d8f2a6be9e1b306d199ba8a1ba6644ca6dec6a3a9d893653f1f1984d1c6
MD5 049e778ff896ac45fe6f27f98939d798
BLAKE2b-256 75e11fc630fee4cb1e03910b2b28276ffa9d0282e94c7745d6556989cca8ec18

See more details on using hashes here.

File details

Details for the file simplabel-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simplabel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for simplabel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3d15ba75e2226820d3d887584357f065b5bfac67c03bf0d1edc88a6b410020
MD5 0b760d35937378eb8ffdced935ede379
BLAKE2b-256 b1ffc614c3791dc56ce3e5408a3b38235be274dc636eeab440846ed3608b76b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page