mpatacchiola / deepgaze

Computer Vision library for human-computer interaction. It implements Head Pose and Gaze Direction Estimation Using Convolutional Neural Networks, Skin Detection through Backprojection, Motion Detection and Tracking, Saliency Map.
MIT License
1.79k stars 478 forks source link

Different head pose angles #98

Closed forwitai closed 4 years ago

forwitai commented 4 years ago

Hello,

I am getting different head pose angles depending on the library I'm using to read the image. Is this normal ? Should I necessarily use OpenCV ?

Thanks.

mpatacchiola commented 4 years ago

Hi @forwitai

Deepgaze uses the color convention of OpenCV which is BGR whereas other libraries generally use the RGB convetion.

If you want to use another library for reading the images you can do it, just convert it to BGR format. You can easily do it with PIL. See this stackoverflow answer for instance:

pil_image = PIL.Image.open('Image.jpg').convert('RGB') 
open_cv_image = numpy.array(pil_image) 
open_cv_image = open_cv_image[:, :, ::-1].copy() 
forwitai commented 4 years ago

I get it now. Thank you for your fast reply, I appreciate it !