-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from miguelaeh/remove_context
feat(core,cli): Replace context by class variables
- Loading branch information
Showing
17 changed files
with
75 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 12 additions & 19 deletions
31
cli/src/pipeless_ai_cli/commands/templates/default/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
# App project directory | ||
# Pipeless application | ||
|
||
An app is a special class that is loaded by the pipeless framework. | ||
This is a bootstrapped Pipeless application using `pipeless create project`. | ||
|
||
You can see an app as an image processing pipeline. It has some stages (see below) and takes an RGB image to return an RGB image. It could be the same input image, a modified image, or even a totally new image. | ||
## Configure the application | ||
|
||
In the case of videos, the app code is automatically executed for every frame of the video, so you just need to care about a single image processing and the framework will take care of the rest. | ||
Open the `config.yaml` file to edit the default configuration. | ||
|
||
## App stages | ||
Find [here](https://pipeless.ai/docs/v0/configuration) the whole list of configuration options. | ||
|
||
An app is build from a set of independent pipeline stages. All stages can be left empty if not required for a particular application. | ||
## Run the application | ||
|
||
In some special cases, you may need to maintain some state between two stages. In those cases you can use the app context, represented in the code by the `ctx` variable. You can access the context in all the stages of the pipeline and its value will be preserved between stages when processing a single image and also between pipeline iterations when processing video frames. In short, anything that you add to the context can be accessed and modified at any stage until the app finishes. | ||
Simply execute: | ||
|
||
### Initial and final stage | ||
```bash | ||
pipeless run | ||
``` | ||
|
||
These stages are executed only once and do not receive nor return any images. They are used when an app requires to execute some code before processing any image and when it needs to execute some code after processing all the images. | ||
## Learn more | ||
|
||
* `before`: code that is executed before starting to process the first frame | ||
* `after`: code that is executed after the processing of the last frame | ||
|
||
### Processing stages | ||
|
||
These are the stages that actually process the images. They receive the image and they **must** return an image. When not implemented they simply forward the previous stage image to the next stage. | ||
|
||
* `pre-process`: code that is executed before the processing of each frame | ||
* `process`: the actual code that processes a frame | ||
* `post-process`: code that is executed after the processing of each frame | ||
To learn more about how to implement the application please refer to the [documentation](https://pipeless.ai/docs). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters