StanislasBertrand / RetinaFace-tf2

RetinaFace (RetinaFace: Single-stage Dense Face Localisation in the Wild, published in 2019) reimplemented in Tensorflow 2.0, with pretrained weights available !
MIT License
258 stars 21 forks source link

what do the params `pixel_means` and `pixel_stds` mean? #5

Closed wulikai1993 closed 4 years ago

wulikai1993 commented 4 years ago

and why operating the image tensor as following, in RetinaFace.detect():

for i in range(3):
        im_tensor[0, i, :, :] = (img[:, :, 2 - i] / pixel_scale - pixel_means[2 - i]) / pixel_stds[
            2 - i]
net_out = self.model.predict(im_tensor.transpose(0, 2, 3, 1))
StanislasBertrand commented 4 years ago

I understand why this is unclear.

In reality this step does 3 things :

I will try to divide this step into 3 distinct steps so it is clearer in the coming days. Or feel free to make a PR for this :)