use preprocessing from opencv

This commit is contained in:
Rodrigo Andrade 2022-05-08 21:27:42 -03:00
parent 9852bbe482
commit a5ecdc1d8c

View File

@ -1,5 +1,6 @@
import os import os
import numpy as np
import cv2 as cv import cv2 as cv
import gdown import gdown
@ -33,11 +34,11 @@ class SFace:
def predict(self, image, bbox=None, **kwargs): def predict(self, image, bbox=None, **kwargs):
# Preprocess # Preprocess
# print(image.max()) image = (image[0] * 255).astype(np.uint8) # revert the iamge to original format and preprocess using the model
# input_blob = self._preprocess(image, bbox) input_blob = self._preprocess(image, bbox)
# Forward # Forward
features = self._model.feature(image[0]) features = self._model.feature(input_blob)
return features return features