Coder Social home page Coder Social logo

Comments (14)

yinguobing avatar yinguobing commented on June 12, 2024 1

Hi @lghasemzadeh

I think the iris model is an updated version of the previous landmark model. I need some time to figure it out.

Meanwhile, it seems Google had provieded a Python API for Mediapipe: https://google.github.io/mediapipe/solutions/face_mesh#python-solution-api

I think the official python API is a better solution. Would you like to try that first?

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024 1

Hi @lghasemzadeh

Do not worry you had described the issue quite well.

I had watched the videos in the mail. After a shot investgation, I found something interesting. But before that we need to clairfy some concepts that will be mentioned later.

First, mediapipe. This is a collection of ML solutions provided by Google, which support multiple running enviourments and various programming languages. Mediapipe is not a model. But it does host many deep learning models that fulfill different tasks. Iris detection is one of them. Mediapipe also provides some other alghrithms besides deep learning models.

Second, TensorFlow.js. From the official description, "TensorFlow.js is a library for machine learning in JavaScript". This is not a model either. You can think of it as a bridge to let the web browser run the deep learning model directly.

At last, the model. Most of the time we use 'model' to refer the deep neural network architectures, like "ResNet", "MobileNet", etc. When you hear people talking about "training" the models, they are very likely to talking about these architectures.

In the blog post from Google you linked above, the authors wrote:

Today, we’re excited to add iris tracking to this package through the TensorFlow.js face landmarks detection model. This work is made possible by the MediaPipe Iris model. We have deprecated the original facemesh model, and future updates will be made to the face landmarks detection model.

There are three "models": face landmarks detection model, Iris model and facemesh model. This could be very confusing as they are all named "models". But follow the hyperlinks it's not hard to tell that

  • face landmarks detection model is a NPM package.
  • Iris model is a solution of Mediapipe.
  • facemesh model is another NPM package.

So what the authors wanted to say is like "TensorFlow.js users, we are providing a new NPM package named face landmarks detection which also have iris detection features. Do not use the old facemsh package any more."

Does this make any sense to you?

If the answer is yes, let's move on to the actual models.

Mediapipe is a collection of solutions. Iris detection is one of them. It is called a solution rather than a model because one solution could rely on multiple deep learning models and some other dependencies. From the offcial document you can find that there are actually three models involved for iris detection:
Face Detection Model, Face Landmark Model and Iris Landmark Model.

At first Mediapipe did not provide Python APIs and that's the reason why I opensourced this repo: to let people run face mesh detection with python. However it seems that Google is providing python APIs for face landmarks now. I don't know when this happend but it is a good news for us. And we should stick to the official python API especially for application development.

Unfortunately, face detection and iris detection currently do not have python APIs. It could take a while before we figuring out how to run them with python. The good news is that they all support C++. If you are really in a hurry and don't mind writting some C++ code, this could be a good start point.

Best,

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024 1

SavedModel is a kind of file format that TensorFlow use to store a neural network. But if you pay close attention you would find that mediapipe does not provide these kind of models and I don't think there is any chance we could get one. Instead they only track the TFLite model on GitHub.

Inference of TFLite model is possible with TensorFlow Lite. This is exactly what I've done in this repository. But it could also be hard because the model is only part of the solution, you need to figure out:

  • is there any preprocessing need to be done, like normalization, etc?
  • what is the input data? What formats do they have? Like dimentions, datatype, channel first or last.
  • how the three models are chained together?

These information are hidden in the C++ code of mediapipe. Translate these code into Python you should get an identical result.

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

@yinguobing Thank you for your response.
The link you sent is the older version (as far as I understood) which doesn't provide iris tracking. I recorded 3 videos from 3 different demos, I will send them to you trough your gmail to show what I am exactly looking for. Please check it out.
Thanks

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

@yinguobing thank you very much for the very detailed explanation :)
I learned and got the answer of lots of my questions.

Yes I am in hurry and really need facemesh together with iris detection. But I don't know C++, languages that I know are Python, Matlab and R. Is there any other solution comes to your mind?

I talked to the developer of the third link that I sent you (Human), and he said I need to convert TensorFlow.js to Python (tfjs to tf) or I have to find a saved model. But I don't know exactly what they are and how to do? and does that converted or saved model give me the thing that I am looking for? what are their outputs? do they work the same as original ones?

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

Hello @yinguobing
thank you for the answer, I really enjoy learning and discuss with people who are working in this field :)

Regarding the issue we discussed above, I am trying to ask it in different forums to find my way and learn.
here is one of them:
tensorflow/tfjs#4395
would you please check and let me know your idea about the converter that is suggested there?

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024

That's interesting! I don't know JS but it seem that TensorFlow.js is using a dirrerent format for model saving?

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

yes, this is the problem that I don't know JS either :)
If I found sth I will let you know as well. at least we can discuss about things and I will learn from you.

Thank you very much for your help

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

Hello @yinguobing I got a bit confused!

I decided to learn JS but when I got to install the iris tracking in solutions of mediapipe I saw in the table that iris detection is not provided for JS!!!!!

Are these two links talk about a single package? Are these two libraries the same?
First
Second
If yes, why their names are different? and the important issue is that why one of them provided for JS but the other didn't.
If no, is the main library is the first link and in the second one this is the same library just it is the JS version of it?

The first link clearly demonstrate that the library is for JS but the second link when we go to solutions,there is a table which shows the iris detection is not provided for JS!!!

Screenshot from 2021-02-17 09-00-07

Would you please help to fıgure out what is going on?

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024

I think the absence of the IRIS checkmark for JS means "Iris detection is not supported solely in JS. It is part of the face landmark solution".

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

Thank you :)

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024

Just curious, have you solved this issue?

from face-mesh-generator.

lghasemzadeh avatar lghasemzadeh commented on June 12, 2024

Hello,

I stop the investigation for a while.
today I checked the mediapipe website and I saw that they change the website and repos, and they launch a new version of mediapipe which provides iris solution for python as well.
Now the problem is I don't want to install new version of mediapipe :D . I want to stay with mediapipe 0.8.3 which doesn't have iris solution for python (referring to the table above). I want to access the iris solution of 0.8.3 using C++. I only want to run a C++ example iris solution. nothing more.
But since the website is changed completely, I don't know how to do so.
Do you have any idea?

Thank you

from face-mesh-generator.

yinguobing avatar yinguobing commented on June 12, 2024

Try these:

  1. Dig out the model file mediapipe used. Find out in what format it was exported (Maybe TFLite?).
  2. Convert the exported model into ONNX format. https://github.com/onnx/onnxmltools
  3. Run model inference with ONNXRuntime. https://onnxruntime.ai/

In this way, you no longer need mediapipe any more.

from face-mesh-generator.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.