SthPhoenix / InsightFace-REST

InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Apache License 2.0
497 stars 116 forks source link

Activating extract/gender-age returns Internal Server Error #64

Closed benizar closed 2 years ago

benizar commented 2 years ago

I would like to use this project to identify gender in a list of jpg photos. The API interface is really helpful with the default example:

imagen

However, when I set gender-age to true it returns an Internal Server Error (even with the Stallone sample photo): imagen

The same error occurs when I upload my own images or using the alternative structure with base64 encoded images. I would appreciate any help for understanding what is going on.

Thank you in advance for this interesting project.

SthPhoenix commented 2 years ago

Hi! Unfortunately gender age is not fully supported right now, as it need different face crop preprocessing than recognition step. Though if you only need gender detection you can set rec_model=arcface_r100_v1 and ga_ignore=False in deploy_trt.sh. With this settings container will use older recognition model with compatible preprocessing.

SthPhoenix commented 2 years ago

Hm... that's strange but it's working with new models too right now. So you only need to set ga_ignore=False

benizar commented 2 years ago

Wow! Thank you for answering so quickly!! :)

You are right, I only had to change this in the _deploycpu.sh script. At least is working with the Stallone image, I will try with my own images but I think we can close this issue.

Thanks again.

SthPhoenix commented 2 years ago

I'm glad I helped you )

Though must admit that insightface gender/age estimation model is not the most accurate.

I have seen presumably better models around GitHub, though they mostly require input image of shape larger than 112x112. So they'll require either upscaling either cropping larger face crops and downscaling it later for recognition, which will noticably hit performance.

benizar commented 2 years ago

Thank you for the advice. I finished my test with the help of InsightFace-REST. I need to check it but at first sight it seems that the results were pretty good.

I will compare these results with other 4 models before deciding which one works better or if I need to train a model for my project. If you are interested in the results I could e-mail them to you once I finish...