pntt3011 / mediapipe_face_iris_cpp

Real-time Face and Iris Landmarks Detection using C++
GNU General Public License v3.0
80 stars 15 forks source link

failed to allocate tensors for face_landmark_with_attension model #12

Open deshmukhavd opened 2 years ago

deshmukhavd commented 2 years ago

Thank you @pntt3011 for your good work. I was trying to use the face_landmark_with_attension model to get more accurate eyelids points.

But it gets failed to allocate tensor. Can you please help/suggest resolving this issue?

error log:

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. ERROR: Encountered unresolved custom op: Landmarks2TransformMatrix. ERROR: Node number 192 (Landmarks2TransformMatrix) failed to prepare.

ERROR: Failed to apply the default TensorFlow Lite delegate indexed at 0. Failed to allocate tensors.

pntt3011 commented 2 years ago

Thank you for your issue, It seems that the Attention model uses a custom op named Landmarks2TransformMatrix along with other tflite built-in ops.

Tflite doc says that we can define custom operators in runtime. So I have tried doing it in my code based on mediapipe's implementation. However, in line 19, we can see that Mediapipe uses their custom version of tflite instead of the original one.

You may have to recompile tensorflow lite with some modifications. I find this file related to the changes but don't know how to use it.

deshmukhavd commented 2 years ago

Thank you for your answer!!! Feels like a complicated thing for me but definitely, I will try. Do you have future plan to integrate the attention model into the current pipeline?

pntt3011 commented 2 years ago

I'm currently using the prebuilt version of tensorflowlite from this repo because I couldn't compile it for some reasons. So I have no plans to do it, at least in the near future, unless someone's kindly enough to build and public the modified version. I'm sorry that I can't be of more help.