'how to process folder (for example training folder) and subfolders(which are the classes,contain images) in google colab and save them in google colab

How to process a folder with, for example, it contains 100 subfolders which contain ten images each subfolder and after processing(any changes) save the image in another place (in colab). I can do it folder by folder, but I want to process all subfolders at the same time, for example, cropping all the images in subfolders at the same time



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source