vladmandic / human

Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gaze Tracking, Gesture Recognition
https://vladmandic.github.io/human/demo/index.html
MIT License
2.39k stars 326 forks source link

Blaze resized image normalization #446

Closed saeidn95 closed 7 months ago

saeidn95 commented 7 months ago

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 commented 7 months ago

done.