Skip to main content

Helper to import images and annotations to Label Studio

Project description

anno2ls

anno2ls is a lightweight helper library to manage image and annotation import/export with Label Studio. It simplifies importing images, pushing pre-annotated data (like LabelMe format), and removing tasks from your project using the Label Studio API.


🔧 Features

  • Upload multiple images to a Label Studio project
  • Import pre-annotated data (supports LabelMe format)
  • Delete empty or all tasks from a project
  • Fetch all filenames or task metadata from a project

📦 Installation

You can install via pip (after publishing to PyPI):

pip install anno2ls

Or use it locally:

git clone https://github.com/Vaaaaaalllll/anno2ls
cd anno2ls
pip install .

🧠 Usage

from anno2ls import anno2ls

# Initialize
from anno2ls import anno2ls

api_token = "your_label_studio_token"
ls_url = "https://your.labelstudio.instance"
project_id = 97

anno = anno2ls(token=api_token, url=ls_url)

# Upload all images from a directory
anno.import_images("path/to/image/folder", project_id)

# Import annotations in LabelMe format
anno.import_preannotated("path/to/json/folder", project_id)

# Delete all tasks in the project
anno.delete_all_task(project_id)

# Delete only empty (no annotation) tasks
anno.delete_empty_task(project_id)

# Get list of all task image filenames
filenames = anno.get_all_filenames(project_id)

📝 Annotation Format Support

Currently supported:

  • LabelMe: Each image must have a .json file with the same base name (minus prefix) in the specified folder.

👤 Author

Val Kenneth Arado 📧 aradovalkenneth@gmail.com


🌐 Project Links

GitHub: https://github.com/Vaaaaaalllll/anno2ls Label Studio: https://labelstud.io

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

anno2ls-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

anno2ls-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file anno2ls-0.1.0.tar.gz.

File metadata

  • Download URL: anno2ls-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for anno2ls-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a97464928e97b4fd4830ebc75fdfab614321318987e72c9448e64b662e83cfdb
MD5 15113fc88cb9678d797f32ec5df1429e
BLAKE2b-256 7e1fd76c5a56066eb9780a5a2ca0059414fcbe39d97b2dfa78207c19f8d255cb

See more details on using hashes here.

File details

Details for the file anno2ls-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anno2ls-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for anno2ls-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5e0851efe41b7c4ade4e008701f2396053c449ce860cd2a704fbc643f6089a
MD5 7febb4100608d9544d7d1f78b1cf6c87
BLAKE2b-256 68820a0518f51d127f44194c48570da3b24126c4e2238434c2c8b26a6a90f52f

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