Pre Processing and Segmentation of bulk images in training or test set

If any body has done preprocessing or segmentation of bulk images using some pipeline, can you please share the code or appropriate resource ?I can understand and implemented preprocessing /segmentations of single image using opencv/imutils but trying to find an effective way to accomplish those tasks in bulk.
Thanks in advance.