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
yaltai alto-to-yolo PATH/TO/ALTOorPAGE/*.xml my-dataset --shuffle .1 --segmonto region

And then train YOLO

# Download YOLOv5
git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install
# Train your YOLOv5 data (YOLOv5 is installed with YALTAi)
python train.py --data "../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 !
yaltai kraken --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.1rc2.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

YALTAi-0.0.1rc2-py2.py3-none-any.whl (26.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for YALTAi-0.0.1rc2.tar.gz
Algorithm Hash digest
SHA256 628320e04f005bca34a948251ded242ce9aec6024c1ea2eddc7b148cb756d067
MD5 e1bfbcaaa627cb2c1f1c5c5be931628e
BLAKE2b-256 bfb4f94c68a7011b79797003b67cfc470dc5ecaa749274987025cd0367b1ec57

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for YALTAi-0.0.1rc2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 39997eb3502132526056737095078bcda5241afee285a3c64cae966f32579323
MD5 df57b0bc9cc2a622e637359e8bac3c58
BLAKE2b-256 0729699028d0c51059c842cd0e898b7a8f5c94246c75015d2047f093f0084e36

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