Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question for Preprocessing Input of ArcFace Model #2660

Open
clariojohan opened this issue Oct 2, 2024 · 1 comment
Open

Question for Preprocessing Input of ArcFace Model #2660

clariojohan opened this issue Oct 2, 2024 · 1 comment

Comments

@clariojohan
Copy link

Hi, I just want to make sure of the preprocessing method for the arcface model is the one here below or the one named inv_preprocess here

Because, when i tried to use the preprocessing the 512 embedding output is always random, but when i tried to use for example facenet preprocessing input, the embedding output is similar each time its generated.

I am looking forward to hear the explanation, Thank You !

@prashant-saxena
Copy link

You can try this

img = #aligned image of face of size 112x112 or what ever size you are looking for
self.input_size = (112, 112)
self.input_mean = 127.5
self.input_std = 127.5
blob = cv2.dnn.blobFromImage(img, 1.0 / self.input_std, self.input_size,
                                    (self.input_mean, self.input_mean, self.input_mean), swapRB=True)

You can pass blob to session created using w600k_r50.onnx (ArcFace) as a single input.
How OpenCV’s blobFromImage works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants