serengil / retinaface

RetinaFace: Deep Face Detection Library for Python
https://www.youtube.com/watch?v=Wm1DucuQk70&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=3
MIT License
1.22k stars 154 forks source link

Doubt: Inside the Preprocessfunction , not changing the dimension to (N,C,H,W) ? #66

Closed mathanprasannakumar closed 1 year ago

mathanprasannakumar commented 1 year ago

Hey , seregil, In the preprocess_image function ,you described changing the image dim from (N,H,W,C) to (N,C,H,W) , but the below code only reversing the channels only (FROM BGR to RGB)

`# Make image scaling + BGR2RGB conversion + transpose (N,H,W,C) to (N,C,H,W)

for i in range(3):
    im_tensor[0, :, :, i] = (img[:, :, 2 - i] / pixel_scale - pixel_means[2 - i]) / pixel_stds[2 - i]`

Is it a mistake or written purposely ? Kindly correct me if i am wrong.

serengil commented 1 year ago

as mentioned in the read me, this is a re-implementation. i copied some code blocks from original repo.

mathanprasannakumar commented 1 year ago

Thanks for the clarification Serengil.