In [2]:
import cv2
import os.path

In [6]:
h,w = 200,200

In [9]:
path = "./tenor/"

In [13]:
frames = [os.path.join(path,f) for f in os.listdir(path) if f.endswith('.jpg')]

In [14]:
frames


Out[14]:
['./tenor/frame_0004.jpg',
 './tenor/frame_0006.jpg',
 './tenor/frame_0002.jpg',
 './tenor/frame_0005.jpg',
 './tenor/frame_0001.jpg',
 './tenor/frame_0003.jpg']

In [17]:
for frame in frames:
    new_frame = frame.replace(".jpg","_.jpg")
    cv2.imwrite(new_frame,cv2.resize(cv2.imread(frame),(200,200)))