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:
Release files for pflows 0.1.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pflows-0.1.23.tar.gz | 5.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pflows-0.1.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 MB
Release files / pflows-0.1.23.tar.gz
| Download URL | pflows-0.1.23.tar.gz |
|---|---|
| Size | 5.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e297dea0588a97d3ddbd00109404bcf0e1ac3b61598b9497e9bbf6416e9b6e0
|
|
BLAKE2b-256 checksum How to use checksums |
59d10e0b0b5e40fec8e5f785a3b33abe4f13de97a3eeb676c7803a123e47a94d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.4
|
Release files / pflows-0.1.23-py3-none-any.whl
| Download URL | pflows-0.1.23-py3-none-any.whl |
|---|---|
| Size | 5.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ec43b1749d04dde024933ea38a17911eedb096631c23a69762a11e98a896d55
|
|
BLAKE2b-256 checksum How to use checksums |
3cb2cc260cf1535219b71ab31ad79a7465971e4f479b4ecd05064869911cb7a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.4
|