Pipeline module provides a class with the same name which is used to represent a Pipeline.
Create simple Pipeline¶
The following script creates a simple pipeline and applies it to a previously loaded image. Info on how to load images can be found here.
from easycv import Pipeline from easycv.transforms import Blur, Grayscale pipeline = Pipeline([Grayscale(), Blur(sigma=50)]) img = img.apply(pipeline) img.show()
This is the same as doing the following (applying each transform separately):
img = img.apply(Grayscale()) img = img.apply(Blur(sigma=50)) img.show()
Save and load Pipeline¶
The following script saves and loads the pipeline created in the last example.
pipeline.save(filename='example.pipe') loaded = Pipeline('example.pipe') img = img.apply(loaded) img.show()
If you are running Easycv inside a jupyter notebook there is no need to call show() , the image will be displayed if you evaluate it.