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()
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()
Access single images¶
Lists support indexing/slicing like normal python lists
[6]:
l[1]
[6]:
[8]:
l[2:4].show()
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()