Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

ONNX-Image-Tagger

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

imagetagger

Image tagging CLI using the Smiling Wolf wd-eva02-large-tagger-v3 ONNX model.

Build

Requires Delphi 11 Alexandria or 12 Athens with 64-bit compiler:

pascal
dcc64 -B imagetagger.dpr

Note: 64-bit build is required due to ONNX model memory requirements.

Deployment

SQLite (Statically Linked)

SQLite is statically linked into the executable via FireDAC.Phys.SQLiteWrapper.Stat. No external sqlite3.dll is required.

ONNX Runtime DLL

The ONNX Runtime DLL (onnxruntime.dll) should be available in:

  • C:\Windows\System32\onnxruntime.dll (64-bit)
  • Or copy to the executable directory

Usage

pascal
imagetagger tag <image> [options]
imagetagger history
imagetagger clear-cache
imagetagger --help
imagetagger --version

Tag an image

pascal
imagetagger tag photo.jpg
imagetagger tag photo.jpg --threshold 0.5 --top 10
imagetagger tag photo.jpg --format json
imagetagger tag photo.jpg --format csv

Options

  • --threshold <0.0-1.0> - Minimum confidence threshold (default: 0.35)
  • --top <n> - Maximum number of tags to return (default: 20)
  • --format <text|json|csv> - Output format (default: text)
  • --db <path> - Custom database path

View history

pascal
imagetagger history

Clear cached model

pascal
imagetagger clear-cache

Model

On first run, the tool downloads the wd-eva02-large-tagger-v3 onnx model from HuggingFace.

Models are cached in the models/ subdirectory next to the executable.