List Examples

[1]:
from easycv import List, Image
from easycv.transforms import GrayScale, Canny

Creating a list

We can create a list of random images using random()

[2]:
l = List.random(4)

To view the images, we can call the show method

[3]:
l.show()
../_images/examples_list_6_0.png

Apply transforms

We can apply transforms to List exactly like we would apply them to a single image

[4]:
l = l.apply(GrayScale())
l.show()
../_images/examples_list_9_0.png

Access single images

Lists support indexing/slicing like normal python lists

[6]:
l[1]
[6]:
../_images/examples_list_12_0.png
[8]:
l[2:4].show()
../_images/examples_list_13_0.png

Parallel processing

To process images in parallel just set parallel to True on apply. Note that for non-lazy images, small ammounts of images and fast operations this could be slower thatn withou parallelism!

[9]:
l = l.apply(Canny(), parallel=True)
l.show()
../_images/examples_list_16_0.png