1import cv2
2import numpy as np
3
4img = cv2.imread('your_image.jpg')
5res = cv2.resize(img, dsize=(54, 140), interpolation=cv2.INTER_CUBIC)
1import cv2
2#img is your image as array
3
4#size of the new image
5height = 500
6width = 500
7
8img_resized = cv2.resize(img, (width, height))