Skip to main content

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:

Birds Dataset

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:

  1. Download the dataset from Roboflow
  2. Load the dataset
  3. Count the number of images
  4. Count the number of categories
  5. Group the categories, to create new categories based on the existing ones (upper, lower, middle)
  6. Keep only the categories that are in the groups "upper", "lower" and "middle"
  7. Count the number of images
  8. Count the number of categories
  9. Show the categories
  10. 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:

Bird 1 before Bird 1 before

Example Bird 2:

Bird 2 before Bird 2 before

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)

Source distribution for pflows 0.1.23
File Size Uploaded
pflows-0.1.23.tar.gz 5.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pflows 0.1.23
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.23 This release

2 release files

0.1.22

1 release file

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page