1import PIL
2from pathlib import Path
3from PIL import UnidentifiedImageError
4
5path = Path("INSERT PATH HERE").rglob("*.jpeg")
6for img_p in path:
7 try:
8 img = PIL.Image.open(img_p)
9 except PIL.UnidentifiedImageError:
10 print(img_p)
11
1>>> from scipy import misc
2>>> import matplotlib.pyplot as plt
3>>> fig = plt.figure()
4>>> plt.gray() # show the filtered result in grayscale
5>>> ax1 = fig.add_subplot(121) # left side
6>>> ax2 = fig.add_subplot(122) # right side
7>>> ascent = misc.ascent()
8>>> result = gaussian_filter(ascent, sigma=5)
9>>> ax1.imshow(ascent)
10>>> ax2.imshow(result)
11>>> plt.show()
12