Skip to main content

A Python library for browser-based manual image classification

Project description

Classto

Classto is a Python library for building lightweight, browser-based tools to manually classify images into custom categories - ideal for preparing datasets or sorting visual content.

With just a few lines of Python, Classto spins up a local web interface built on Flask and styled with Tailwind CSS to let you quickly review, label, and organize images - right from your browser.

Interface Previews

Classto Light Mode     Classto Dark Mode

Classto in Light and Dark Mode

 

Features

  • Classify images with one click
  • Supports custom category lists
  • Images are moved into subfolders per label
  • Optionally add unique filename suffixes
  • CSV logging for ML dataset tracking
  • Delete unwanted images during classification
  • Dark mode toggle built in

Installation

You can install Classto via pip:

pip install classto

Quickstart

import classto as ct

app = ct.ImageLabeler(
    classes=["Cat", "Dog"],
    image_folder="images",          # Path to your images
    delete_button=True,             # Optional delete button
    suffix=True,                    # Add unique suffix to avoid conflicts
    log_to_csv=True                 # Save results to labels.csv
)

app.launch()

Then open your browser at http://127.0.0.1:5000.

Example Folder Structure

Place your images in a folder (e.g. images/) relative to your script:

project/
├── images/
│   ├── cat1.jpg
│   ├── cat2.jpg
│   ├── dog1.jpg
│   └── dog2.jpg
├── app.py

After classification, images are moved to:

project/
├── classified/
│   ├── Cat/
│   │   ├── cat1__K8dLs.jpg
│   │   └── cat2__a7JkL.jpg
│   ├── Dog/
│   │   ├── dog1__Xy4Tz.jpg
│   │   └── dog2__Zx9Pm.jpg
│   └── labels.csv

Parameters

  • classes (List[str]): A list of categories for classification (e.g. ["Dog", "Cat"]).
  • image_folder (str): Path to the folder containing the images to classify. Defaults to "images".
  • delete_button (bool): If True, shows a delete button to remove images. Defaults to False.
  • suffix (bool): If True, appends a random suffix to filenames to avoid overwriting. Defaults to False.
  • log_to_csv (bool): If True, logs each classification into a CSV file. Defaults to False.
  • shuffle (bool): If True, images are shown in random order. Defaults to False.

How it works

  1. Classto loads images from your specified folder (e.g. images/)
  2. Each classification moves the image to classified/<category>/
  3. Optionally appends a suffix to the filename
  4. If enabled, logs the action to a labels.csv file in classified/

CSV Logging Format

If log_to_csv=True is enabled, each classification is logged to a labels.csv file inside the classified/ directory. The file contains the following columns:

original_filename new_filename label timestamp
img01.jpg img01__4Fg7T.jpg Cat 2025-08-19T10:58:00+00:00
  • original_filename: The name of the image before classification.
  • new_filename: The new name after suffixing (if enabled).
  • label: The category selected during classification.
  • timestamp: When the classification occurred, in ISO 8601 format (UTC).

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

classto-2.0.0.tar.gz (457.8 kB view details)

Uploaded Source

Built Distribution

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

classto-2.0.0-py3-none-any.whl (453.6 kB view details)

Uploaded Python 3

File details

Details for the file classto-2.0.0.tar.gz.

File metadata

  • Download URL: classto-2.0.0.tar.gz
  • Upload date:
  • Size: 457.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for classto-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3e81b29783db688867699cc8527074a7f78d0ce689ac05777d2c1e5ba3a45e13
MD5 7c73b02b7d3ed338680c4180a721877c
BLAKE2b-256 544a285f9e2d9cfab18d9d3117649f18e0211cddc157fd6427889f02808d1467

See more details on using hashes here.

File details

Details for the file classto-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: classto-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 453.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for classto-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97fc0985eb69d3ca4c442aade3a4d96aec313e28ede0b46820d4a218b95ce724
MD5 95c62bbcf1ed9a726a5eb02a93f7be1f
BLAKE2b-256 bc51a87b27feab31a58b17bb8d3a9ec75faf716abf87d56baa7cc2296a5accad

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