In [8]:
import matplotlib.pyplot as plt
import cv2
import os
from scipy.misc import imsave
%matplotlib inline
In [9]:
dir_in = "./data/IMG/"
dir_out = "./data/IMG_FLIP/"
 
for fn in os.listdir(dir_in):
    img_file = dir_in + fn
    img = plt.imread(img_file)
    fimg = cv2.flip(img,1)
    imsave(dir_out + fn, fimg)
In [ ]: