Skip to main content

You Actually Look Twice At it, YOLOv5-Kraken adapter for region detection

Project description

YALTAi

You Actually Look Twice At it

This provides an adapter for Kraken to use YOLOv5 Object Detection routine.

This tool can be used for both segmenting and conversion of models.

Routine

Instal

pip install YALTAi

Training

Convert (and split optionally) your data

# Keeps .1 data in the validation set and convert all alto into alto
#  Keeps the segmonto information up to the regions
python -m yaltai.yaltai alto-to-yolo PATH/TO/ALTOorPAGE/*.xml my-dataset --shuffle .1 --segmonto region

And then train YOLO (note that I recommend using the repository and not the CLI) as the CLI provided with the library keeps for looking at the wrong place (it needs absolute path)

# Train your YOLOv5 data (YOLOv5 is installed with YALTAi)
yolov5 train --data "$PWD/my-dataset/config.yml" --batch-size 4 --img 640 --weights yolov5x.pt --epochs 50

Predicting

YALTAi has the same CLI interface as Kraken, so:

  • You can use base BLLA model for line or provide yours with -m model.mlmodel
  • Use a GPU (--device cuda:0) or a CPU (--device cpu)
  • Apply on batch (*.jpg)
# Retrieve the best.pt after the training
# It should be in runs/train/exp[NUMBER]/weights/best.pt
# And then annotate your new data with the same CLI API as Kraken !
python -m yaltai.kraken_yaltai --device cuda:0 -I "*.jpg" --suffix ".xml" segment --yolo runs/train/exp5/weights/best.pt

Metrics

The metrics produced from various libraries never gives the same mAP or Precision. I tried

  • object-detection-metrics==0.4
  • mapCalc
  • mean-average-precision which ended up being the chosen one (cleanest in terms of how I can access info)

and of course I compared with YOLOv5 raw results. Nothing worked the same. And the library YOLOv5 derives its metrics from is uninstallable through pip.

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

YALTAi-0.0.1rc0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

YALTAi-0.0.1rc0-py2.py3-none-any.whl (26.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file YALTAi-0.0.1rc0.tar.gz.

File metadata

  • Download URL: YALTAi-0.0.1rc0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for YALTAi-0.0.1rc0.tar.gz
Algorithm Hash digest
SHA256 aa8e9605c9cc8e2c27264914e859047a9ba29738cc29374117a39d06b1d15f11
MD5 4cad01cc704b21d77d96f00840af4bf7
BLAKE2b-256 2b35fdfc2a0c56933dd9ad54996e6222181a3e0f87546fed368dea161c37b0fd

See more details on using hashes here.

File details

Details for the file YALTAi-0.0.1rc0-py2.py3-none-any.whl.

File metadata

  • Download URL: YALTAi-0.0.1rc0-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for YALTAi-0.0.1rc0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f5606ca2272c93769e5e4cb4448e12bcd1822f8ae897cc71deda669ede02625f
MD5 2866342a764b05ced6a8d83e7a2cced5
BLAKE2b-256 a95a4e356cbfa4367504e9a94a5a434edb2823c03af02fa80c0cf8e6c888d849

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page