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

Command line tools

Pass the categories 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. A 'remove' label is automatically added to the list of passed categories.

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

After the first use, labels are stored in 'labels.pkl' and there is no need to pass the '--categories' argument unless you want to add labels. You can also use '--reset' to delete the saved labels and dictionary from the directory before execution.

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

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()

Saved labels

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

import pickle

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

Move labeled images to discrete directories

This utility copies labeled images from the raw directory to discrete folders by label in the labelled directory using the dictionary created by simplabel.

from simplabel import utils

utils.flow_to_dict(rawDirectory, labelledDirectory)

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.0.4.tar.gz (7.2 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.0.4-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplabel-0.0.4.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for simplabel-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1c8742f1b4acec273e0539534279ffaa4d7dc3c71f9bdf419b4205efd72e058d
MD5 c525dfb8aa7585679f4b3f379446586e
BLAKE2b-256 073c831a6591ae0ceb7348649757613777e39d66d23e789ccaa3524844f3c492

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simplabel-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for simplabel-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e6ce17560cf4aa011e11c1749352a337fbf7adc3ff0172de88989b634caede6f
MD5 c34cde4b56b755297f83a1e620ffd909
BLAKE2b-256 af3e47777aa7e4c9ae6ec7b6013af3fad6c4d03df313e8cb1c104ac7114a2acc

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