Skip to main content

Create object-detection datasets (YOLO) using Moondream

Project description

MoonLabel

MoonLabel Logo

An object-detection labelling tool.

Powered by Moondream VLM


Overview

MoonLabel is both a Python library and a tiny web UI to generate object-detection datasets quickly.

  1. Use the library to auto-label folders of images and export YOLO.
  2. Or launch the UI and visually export YOLO with one click.

Backends supported: Moondream Cloud, Moondream Station, or fully local (Hugging Face).

Demo

https://github.com/user-attachments/assets/ced0beeb-9f2a-498e-b6fc-406efb16b17d


Features

  • 📦 Library + UImoonlabel package with an optional web UI.
  • 🌐 FastAPI server — Served by a single moonlabel-ui command.
  • ⚛️ Modern frontend — React, TypeScript, TailwindCSS, Vite.
  • 🖼️ Object detection — Choose between Moondream Cloud, the open-source Hugging Face model, or the native Moondream Station app.
  • GPU-accelerated & offline — Local and Station modes automatically use available hardware acceleration (CUDA / MPS).

Install

  • Library only (Cloud/Station by default):
pip install moonlabel
  • Library + UI server:
pip install "moonlabel[ui]"
  • Local inference (Hugging Face) extras:
pip install "moonlabel[local]"
  • Both UI and local inference:
pip install "moonlabel[ui,local]"

Quick Start (UI)

pip install "moonlabel[ui]"
moonlabel-ui    # opens http://localhost:8342

Choose backend in Settings:

  • Moondream Cloud: paste API key
  • Moondream Station: set endpoint (default http://localhost:2020/v1)
  • Local (Hugging Face): install local extras and select Local

Quick Start (Library)

from moonlabel import create_dataset

# Cloud
create_dataset("/path/to/images", objects=["person"], api_key="YOUR_API_KEY")

# Station
create_dataset("/path/to/images", objects=["car"], station_endpoint="http://localhost:2020/v1")

# Local (after: pip install "moonlabel[local]")
create_dataset("/path/to/images", objects=["bottle"])  # no key needed

This produces a YOLO dataset directory with images/, labels/, and classes.txt.

Moondream Station Mode

The backend can connect to a running Moondream Station instance for fast, native, on-device inference.

  1. Download, install, and run Moondream Station.
  2. Ensure the endpoint matches your Station configuration (default: http://localhost:2020/v1).

Local Mode (Hugging Face)

The backend can run fully offline using the open-source vikhyatk/moondream2 checkpoint.

  1. pip install "moonlabel[local]"
  2. In the UI, select Local (no API key required).

The first detection will trigger a one-off model download to ~/.cache/huggingface/; subsequent runs reuse the cached weights.

GPU / Device selection

The backend chooses the best device automatically in the following order: CUDA → Apple Silicon (MPS) → CPU.

Override via environment variable before launching the backend:

# Force GPU
export MOONDREAM_DEVICE=cuda

# Force Apple Silicon
export MOONDREAM_DEVICE=mps

# CPU only
export MOONDREAM_DEVICE=cpu

Project Structure

moonlabel/
├── src/moonlabel/             # Python package (library + server)
│   ├── dataset.py             # create_dataset API
│   ├── infer.py               # Moondream wrapper (cloud/station/local)
│   └── server/                # FastAPI app + static assets
│       ├── api.py
│       ├── cli.py             # moonlabel-ui entrypoint (port 8342)
│       └── static/            # embedded UI build (no npm for users)
├── ui/                        # Frontend source (for maintainers)
│   └── dist/                  # Built files to embed
├── scripts/embed_ui.py        # Copies ui/dist → src/moonlabel/server/static
├── Makefile                   # make ui-build, ui-embed, release
└── pyproject.toml

Roadmap / TODOs

Below are planned enhancements and upcoming features. Contributions welcome!

  • Local Hugging Face model support – Offline inference with optional GPU acceleration.
  • Moondream Station integration – Native Mac/Linux app support for on-device inference.
  • Batch uploads – Label multiple images in one go, with progress tracking.
  • Additional export formats – COCO JSON and Pascal VOC alongside YOLO.

License

This project is licensed under the terms of the Apache License 2.0. See LICENSE for details.

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

moonlabel-0.1.0.tar.gz (166.8 kB view details)

Uploaded Source

Built Distribution

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

moonlabel-0.1.0-py3-none-any.whl (166.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for moonlabel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cb361e64a29420542b7fb2d1dd1d6020ed103f3d98dbbec81ec5c20e290bb782
MD5 6d8b0f7137d52313708c17c34ad519af
BLAKE2b-256 337225ba78d85ce66a4baaf940f8d900369f52c0756e9c4c4dbaff8c82065352

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for moonlabel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19015e001504f8b89aee8b7a77c34d001e9592e5cb0f3e2cf753de9568de2352
MD5 85073f324f2ed276bd2ef3d0aa4bb1a6
BLAKE2b-256 828a75c552e81ca254ea48bbcdda74afae7f5d91c7332f357e4af93267e6dbd1

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