import cv2 import numpy as np from matplotlib import pyplot as plt import os # edges.py reads an image and outputs transformed image def make_edges(image): img = cv2.imread(image) tail = os.path.split(image)[1] edges = cv2.Canny(img,100,200) plt.imsave(os.path.join("/pfs/out", os.path.splitext(tail)[0]+'.png?as=webp'), edges, cmap = 'gray') # walk images directory and call make_edges on every file
![Home Page | Pachyderm](https://cdn-ak-scissors.b.st-hatena.com/image/square/71e6ad0d0830e03377e9458440f4c9f553c388c5/height=288;version=1;width=512/https%3A%2F%2Fwww.pachyderm.com%2Fwp-content%2Fuploads%2F2022%2F02%2FScreen-Shot-2022-02-22-at-4.24.39-PM-8.png)