mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 12:35:22 +00:00
use preprocessing from opencv
This commit is contained in:
parent
9852bbe482
commit
a5ecdc1d8c
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user