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

Blaze resized image normalization #446

Closed
saeidn95 opened this issue Apr 12, 2024 · 1 comment
Closed

Blaze resized image normalization #446

saeidn95 opened this issue Apr 12, 2024 · 1 comment
Assignees

Comments

@saeidn95
Copy link

Issue Description
human/src/face/blazeface.ts
t.normalized = tf.sub(t.div, constants.tf05); does not normalize to (-1, 1).

For normalization to (-1, 1) please change to
t.normalized = tf.sub(t.div, constants.tf1);

t.div = tf.div(t.resized, constants.tf127);
t.normalized = tf.sub(t.div, constants.tf05);
normalized = image / 127 - 0.5

const normalizedImage = tf.mul(tf.sub(tf.div(resizedImage, 255), 0.5), 2);
normalized = (image / 255 - 0.5) * 2

@vladmandic
Copy link
Owner

done.

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