Several tools for dealing with image annotations to train YOLO or similar models
Project description
Pflow
Install
pip install -e '.[dev]'
Setup
cp .env.default .env
Run
pflows doc/examples/birds-grouped-categories.json
In this example, we defined a workflow to download the dataset from Roboflow as we can see in the image below:
The workflow is defined in a JSON file, where we define the steps to be executed:
[
{
"task": "roboflow_tools.download_dataset",
"target_dir": "{{BASE_FOLDER}}/datasets/downloaded/cub200_parts-50",
"url": "https://universe.roboflow.com/explainableai-lavbv/cub200_parts/dataset/50"
},
{
"task": "yolo_v8.load_dataset",
"folder_path": "{{BASE_FOLDER}}/datasets/downloaded/cub200_parts-50"
},
{
"task": "base.count_images"
},
{
"task": "base.count_categories"
},
{
"task": "categories.group_categories",
"groups": {
"upper": [["eye", "bill", "head", "nape", "throat"]],
"lower": [["belly", "feet", "tail"]],
"middle": [["Wing", "breast", "back"]],
"Wing": [["Wing"]],
"back": [["back"]],
"belly": [["belly"]],
"bill": [["bill"]],
"eye": [["eye"]],
"feet": [["feet"]],
"head": [["head"]],
"nape": [["nape"]],
"tail": [["tail"]],
"throat": [["throat"]]
},
"condition": "any"
},
{
"task": "categories.keep",
"categories": ["upper", "lower", "middle"]
},
{
"task": "base.count_images"
},
{
"task": "base.count_categories"
},
{
"task": "base.show_categories"
},
{
"task": "yolo_v8.write",
"target_dir": "{{BASE_FOLDER}}/datasets/processed/birds-grouped-categories-cub200_parts-50"
}
]
The workflow is composed of the following steps:
- Download the dataset from Roboflow
- Load the dataset
- Count the number of images
- Count the number of categories
- Group the categories, to create new categories based on the existing ones (upper, lower, middle)
- Keep only the categories that are in the groups "upper", "lower" and "middle"
- Count the number of images
- Count the number of categories
- Show the categories
- Write the dataset to disk
As we can see, we can use the {{BASE_FOLDER}}
variable to refer to the base folder of the project.
These variables are defined in the .env
file, which is used to configure the project.
We can see the input images and output images below:
Example Bird 1:
Example Bird 2:
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 pflows-0.1.16.tar.gz
.
File metadata
- Download URL: pflows-0.1.16.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82bcf76be8e2e3b4af22ac447af5d366149d5545f9ef4e4f42927db6f89bfcd1 |
|
MD5 | e8a8d08fd62786bbebec3689b41860a4 |
|
BLAKE2b-256 | 949e416b29c6c80ff2fe553b2a94a0670f101c2242caf074ad516efb43acf065 |
File details
Details for the file pflows-0.1.16-py3-none-any.whl
.
File metadata
- Download URL: pflows-0.1.16-py3-none-any.whl
- Upload date:
- Size: 5.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c18b528d71fb6c8dcfae37714ece3c2a28558ee5c11e6bfc0da54381249938 |
|
MD5 | 86ad9b9e131e8aff74618f51f9776229 |
|
BLAKE2b-256 | 196510c8edd8cb20b8750f40a9927e24daf9cbb53491cb0c410f1060f1c1c87c |