I downloaded a program and trying to run it. I am facing some issues due to deprecation of Scipy essentials.
Previous programs consists of code related to scipy. In brief the operations are as follows:
import scipy
scipy.misc.imread(filename)
scipy.misc.imresize(img, (299, 299, 3), interp='bilinear')
(Note that these lines are not in sequence as in program, I just wrote the steps where I am facing issue. The lines given above are exactly replaced by the lines given in code sample below.)
Since many of them are not available now. I searched and trying to change as follows 1, 2
import matplotlib
from matplotlib import pyplot
import cv2
img = matplotlib.pyplot.imread(filename)
img = cv2.resize(img, dsize=(299, 299, 3), interpolation=cv2.INTER_LINEAR)
But, i am still getting the following error
cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'resize'
> Overload resolution failed:
> - Can't parse 'dsize'. Expected sequence length 2, got 3
> - Can't parse 'dsize'. Expected sequence length 2, got 3
It seems that opencv just resize two dimensional images only.
Is there any simple option i.e., using single library, to perform the desired operations without producing any error? If not, how can I resize that image numpy array with bilinear interpolation?