google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.37k stars 5.14k forks source link

Accessing the mediapipe's different solutions #4041

Closed lghasemzadeh closed 1 year ago

lghasemzadeh commented 1 year ago

Hello,

I want to start from a basic question and then descend to my main question. By installing MediaPipe (python version), will we have access to all the solutions (iris, object detection, ...) provided by mediapipe library? I mean I want to install mediapipe and use all the solutions listed on the main page, is it possible? Thx

ayushgdev commented 1 year ago

Hello @lghasemzadeh Yes. The Python MediaPipe installation from pip will give you access to all solutions listed on the MediaPipe documentation.

lghasemzadeh commented 1 year ago

I have installed python mediapipe 0.8.3 in ubuntu about 2 years ago, following the instruction in this link (the instruction doesn't use pip!). But I can not access all the solutions like iris and object detection.

I have questions: 1) Is the installation instruction in the link above updated? or it is old and useless? 2) to install python mediapipe can I use that instruction (ubuntu) step by step without making any changes? since I saw different installation method in forums/pages. 3) by the answer above you mean 'The Python MediaPipe installation from pip will give us access to all READY TO USE solutions listed on the MediaPipe documentation.' right? 4) if yes why the table in this link shows that iris solution is not available for python? 5) in my case, not having the access to iris and object detection solution causes by having old version of mediapipe or causes by the installation method I used (I didn't use pip)? 6) to get access to iris and object detection solution what should I do? 7) How can I find the compatible python version of specific mediapie version? for example, what is the compatible python version for mediapipe 0.8.11?

I need the answer to all the questions above, please. Thank you so much

ayushgdev commented 1 year ago

Hello @lghasemzadeh Please find your questions answered below:

  1. The installation instructions are correct and up to date.
  2. Yes you can use the instructions available on documentation here without any changes. But this will only install deps like OpenCV and Bazelisk into the OS so that the operating system can leverage the hardware when asked by user using any Python, C++, or Java APIs. Corresponding APIs should be installed via their respective tutorials. For example in your case, you should follow the Python instructions here
  3. Yes, they are ready to use solutions. Ready to use in the sense that the APIs can be leveraged to use the internal Graphs and machine learning models without any training required beforehand.
  4. Yes, the Iris solution is not available for Python. The solution availability table is up to date so you can rely on it.
  5. Iris and object detection are not available in Python APIs. So it is not an installation issue.
  6. It looks like you will be building desktop apps with Python. So you can use C++ solution which is having the highest range of solutions available.
  7. To find a compatibility for Python and MP versions, you will need to check the release notes to find which versions are supported. For example, Python v3.10 support was released with MediaPipe v0.8.9 as documented here. We are aware it is not the most convenient method, but we are working on improving documentation of MediaPipe.
google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 1 year ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No

lghasemzadeh commented 1 year ago

Thank you. But I got confused. 1) If the iris solution is not provided for python why I can achieve iris landmarks? I can get access to the left 4 iris landmarks and 4 right iris landmarks. We know that facemesh has 468 landmarks but I get 468+8 landmarks! And I saw somewhere that they can achieve 468 + 8 (iris landmarks) + 2 (iris centers) landmarks. 2) would you please share a link which it it I can get the whole facial landmark IDs (containing left and right iris). This link is not helpful since the iris landmarks are not provided in it.

lghasemzadeh commented 1 year ago

I updated my last comment above and waiting for your response.

ayushgdev commented 1 year ago

Thanks for the update @lghasemzadeh . Apologies that your reply was missed amid other issues since this was already closed. The observations are interesting. Will get back to you on this after checking.

ayushgdev commented 1 year ago

Hello @lghasemzadeh

  1. There is no Python solution for Iris detection independently, however, since FaceMesh solution supports an option to include Iris Landmarks as well, you are able to get those landmarks. The input_side_packet "WITH_ATTENTION" is provided via the argument refine_landmarks of the FaceMesh() constructor.
  2. Although the visual representation is not available, the whole facial landmark indices can be found in face_mesh_connections.py file
google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 1 year ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No

lghasemzadeh commented 1 year ago

Hello @ayushgdev ,

Thank you very much for the previous useful response. It was exactly what I was looking for.

Now I want to know the minimum version (first version) in which the iris landmarks are provided? I don't want to use latest versions of mediapie. I want to use the most early version that the 8 iris landmarks are included, to upgrade my old mediapipe to that version.

I had python mediapipe 0.8.3 and I couldn't access iris landmarks by tuning refine_landmarks. So I installed the python mediapipe version of 0.8.11 and I was able to achieve those 8 iris landmarks by tuning 'refine_landmark'. From which version of 'mediapipe python' the 8 irises landmarks were included into facemesh?