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 YOLOv5 format
# 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
git checkout v6.2
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file YALTAi-0.1.2.tar.gz
.
File metadata
- Download URL: YALTAi-0.1.2.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c486ba55564d47e646b1799f7541dcd357dac525e2c66310a2e3f7a1269df72 |
|
MD5 | 2e7d6593ceed5713c61233cc9ad72295 |
|
BLAKE2b-256 | a81686927ed42d7f883f0f48533f19dac98e6365daed2411b0e62fc1f13a3738 |
File details
Details for the file YALTAi-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: YALTAi-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 838a08a8559c4fa08ab10a40bcceec4c95dc9e1210f760104f51d592462bf2b8 |
|
MD5 | 65a9308be6b16df1a1059959d136ea73 |
|
BLAKE2b-256 | d5a00a257d9227110f0d9aa647a3ffc41a6be65da5a57997300ce04c5697b9e5 |