how to resize image for arcface?

185 views Asked by At

Hi I am trying to use arcface model with this code:

from deepface.basemodels.ArcFace import loadModel as loadArcFace
model = loadArcFace()
img = Image.open('face.jpg')
img = img.resize((112, 112), Image.ANTIALIAS)
img = np.array(img)
model.predict(np.array(img))

But I get the following error:

ValueError: Input 0 of layer "ResNet34" is incompatible with the layer: expected shape=(None, 112, 112, 3), found shape=(None, 112, 3)

But img.shape contains:

(112, 112, 3)

How can I reshape in order to use arcface?

Thanks

0

There are 0 answers