/kesa

tool for auto labeling, conversion and augmentation for darknet YOLO (and other annotation formats)

Primary LanguageRustGNU General Public License v3.0GPL-3.0

kesa (កេសា)

tool for auto labeling, conversion and augmentation for darknet YOLO (and other annotation formats?).
kesa comes with a few binaries.

name explanation
kesa_al for auto labeling, comes with onnx (ort) and torch (tch-rs) backends
kesa_l2y for converting annotations to yolo txt format
kesa_split for separating images/annotations to train, val, test batches.
kesa_aug creates image augmentations from given labels and images

external dependencies

currently kesa_al uses either torch(tch-rs) or onnxruntime(ort) to label images, you can compile with either or both. you just need to download and link the libraries.

onnxruntime

  • build/download library onnxruntime
  • add to your ~/.zshrc or ~/.bashrc:
    export LD_LIBRARY_PATH=/path/to/onnxruntime-linux-x64-cuda-1.17.1/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

tch-rs

wip

  • download libtorch from pytorch site
  • add to your ~/.zshrc or ~/.bashrc:
    export LIBTORCH=/media/hbpopos/penisf/libtorch-cxx11-abi-shared-with-deps-2.2.0+cu121/libtorch
    export LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH
  • alternative options for installing tch-rs can be found here

building

make sure you have the dependencies listed above
to build , run:

cargo build --release

by default, kesa_al currently won't work without a backend specified, enable it by passing a feature flag.

// enable onnxruntime backend
cargo build --bin kesa_al --release --features onnxruntime

// enable torch backend
cargo build --bin kesa_al --release --features torch

// enable both
cargo build --bin kesa_al --release --features torch --features onnxruntime