GithubHelp home page GithubHelp logo

pntt3011 / mediapipe_face_iris_cpp Goto Github PK

View Code? Open in Web Editor NEW
79.0 2.0 15.0 10.97 MB

Real-time Face and Iris Landmarks Detection using C++

License: GNU General Public License v3.0

CMake 4.19% C++ 95.81%
iris-detection cpp opencv tflite face-landmark-detection real-time cpu mediapipe-facemesh mediapipe-face-detection mediapipe-iris

mediapipe_face_iris_cpp's Introduction

Code Time

Profile Views

๐Ÿฑ My GitHub Data

๐Ÿ† 36 Contributions in the Year 2022

๐Ÿ“ฆ 1.1 MB Used in GitHub's Storage

๐Ÿšซ Not Opted to Hire

๐Ÿ“œ 23 Public Repositories

๐Ÿ”‘ 29 Private Repositories

I Mostly Code in Python

Python                   12 repos            โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   30.0% 
Kotlin                   8 repos             โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   20.0% 
Jupyter Notebook         5 repos             โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   12.5% 
C++                      5 repos             โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   12.5% 
JavaScript               5 repos             โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   12.5%

Timeline

Chart not found

Last Updated on 09/11/2022 18:47:21 UTC

mediapipe_face_iris_cpp's People

Contributors

pntt3011 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mediapipe_face_iris_cpp's Issues

Crash during Debug

Hello.
I built your repo and Release works like a charm. But it crashes during Debug. Interpreter and its subgrapsh have lot of garbage. Did you encouner such issue?
Thanks in adnvance

Question about depth estimation

I see in code comments that I can get depth estimation from the model output inside getEyeLandmarkAt by float _d = model->getOutputData(isIris)[index * 3 + 2];. Can you please say what kind of postprocessing needs to be done on this output? Seems there should be some postprocessing, because by printing the value I get also negtaive values.

Question about resolution settings causing inaccuracy

I tried to change the resolution to 1280*720 and found that it was no longer accurate. Is it because of the model? If yes, does it mean that I need to retrain the model?

In addition, there will be jitter, even if I stay in front of the camera motionless. Is there any good solution for this. so many Thanks!

Change resolution

When I use the following statement to change the resolution of the camera (changing the resolution from the default 640 * 480 to 1280 * 720), why does the average frame rate increase instead?
cap.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 720);
1280*720๏ผš
image

640*480๏ผš
image

I hope you can answer, thank you!

Info request : What are the values output by the face_detector.tflite ?

The Regressor shape: (1, 896, 16) and Classifier shape: (1, 896, 1) values output by face_detector.tflite when there is only one facein the image are undocumented, or I could not find anywhere their meaning.

lets pretend thatthe classifier outputs a score for each of the 896 potential bounding boxes to have a face inside, then the highest value of the classifier is tied to 16 valuesof the regressor .
I could not find what these mean...for instance I got these values :

Classifier highes raw value: [1.8791088]
Regressor raw values related to the Classifier Highest raw value: [ -9.997869 5.4132013 97.73436 97.71959 -31.320122 -15.798918 13.305289 -12.395595 11.063564 11.03928 -12.75334 30.372728 -53.83273 -10.672908 34.493393 -3.749894 ]
what are their meaning? thanks for the info :)

About the ROI

The landmarks detected in this project are sometimes inaccurate and jittery.After reading the code, I think it is because the ROI here is inconsistent with the ROI croped by the original processing method of mediapipe.In addition to find the face area, I think it is necessary to do affine transformation to the area before feed it to landmark model.Also, mediapipe uses the landmark-refine model, is it possible to implement it in this project?

ๅ…ณ้”ฎ็‚นๅ‡†็กฎๅบฆ็š„้—ฎ้ข˜

่ฏท้—ฎไธ‹๏ผŒๅฝ“ๅœจ640480็š„ๅˆ†่พจ็Ž‡ๆ—ถ๏ผŒๅ…ณ้”ฎ็‚น็š„ไฝ็ฝฎ็œ‹่ตทๆฅๆฏ”่พƒๅ‡†็กฎ๏ผŒๅฝ“ๆˆ‘่ฎพ็ฝฎๆˆ1280720ๆ—ถ๏ผŒๅ…ณ้”ฎ็‚นๆฃ€ๆต‹็š„ไฝ็ฝฎๅฐฑไธๅคชๅ‡†็กฎไบ†๏ผŒ็‰นๅˆซๆ˜ฏ่„ธ้ƒจ่ฝฎๅป“็š„ไฝ็ฝฎ๏ผŒไผš่ถ…ๅ‡บ่„ธ้ƒจ็š„่Œƒๅ›ด๏ผŒ่ฏท้—ฎ่ฟ™ไธชๆ˜ฏไป€ไนˆๅŽŸๅ› ๅ‘ข๏ผŸ

How to extend this project for selfie segmentation?

Hi,
This repo is the only repo I could find to use mediapipe in a C++ application. Thanks for sharing it.

Can you please show the right way of adding a class for selfie segmentation and create a demo similar to the python example?

Output vector not same as mediapipe

Firstly, very nice implementation. However, I am facing some issues understanding the output of your work. I ran through your face detection code, and the output of your model is (896,4). However, the original output from mediapipe is (896,16). Can you please tell me how to get the additional 4 keypoints associated with face please? Also, where should I make changes in your code if I want my output to be exactly similar to mediapipe. Thank you!

How easy to adopt your code for object detection.

I would like to reuse/generalize your code with ssdlite_object_detection.tflite. How would NUM_SIZES and AnchorOptions look like in this case (assuming that DETECTION_SIZE = 320, NUM_BOXES = 2034, NUM_COORD = 4)?

Please help with hand detection

Hi,

I would like to kindly ask you for help with hands detection using mediapipe and tensorflow.
I used your awesome project (forked here https://github.com/AdrianPeniak/mediapipe_face_iris_cpp.git) and port it to linux env.
However when I reuse your classes for hand detection using palm model I can't get good results (hands not detected, drawing random roi according code in repo). I understand that functions as getHighestScoreDetection() etc. must be rewritten, but I afraid that problem is somewhere before (e.g. image preprocessing).

Could you please take a look to my forked project?

Thanks for any advise.

Thanks

Linux system

Hello, can you send the original tensorflow Lite so file (applicable to Linux system), which was accidentally deleted after downloading. Thank you very much!

image

tensorflow 2.4.4 and bazel build //tensorflow:libtensorflow_cc.so in MacOs 12.1

bug ld: warning: dylib (/private/var/tmp/_bazel_also/c6fd75dad1daa641f8f9e0b5d840292d/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/libtensorflow_cc.so) was built for newer macOS version (12.1) than being linked (12.0)
ld: warning: dylib (/private/var/tmp/_bazel_also/c6fd75dad1daa641f8f9e0b5d840292d/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/libtensorflow_framework.2.dylib) was built for newer macOS version (12.1) than being linked (12.0)
Undefined symbols for architecture x86_64:

failed to allocate tensors for face_landmark_with_attension model

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.

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.