google-ai-edge / mediapipe

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

Getting landmarks for upper lips and chin, to apply beard filter Mediapipe in python? #1886

Closed MuhamaadUsman closed 3 years ago

MuhamaadUsman commented 3 years ago

How can I get facial landmarks in python using Mediapipe face_mesh solution. I want to appy beard filter in python as i don't know C language so how can i do that?

sgowroji commented 3 years ago

Hi @MuhamaadUsman, You can have a look at this issue for some understanding https://github.com/google/mediapipe/issues/1498, https://github.com/google/mediapipe/issues/1106.

ozett commented 3 years ago

skeleton, not full code

with mp_face.FaceDetection(min_detection_confidence=0.5) as face_detection:

        results = face_detection.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))

                h, w, c = image.shape
                # nose
                nx = int(mp_face.get_key_point(detection, mp_face.FaceKeyPoint.NOSE_TIP).x * w)
                ny = int(mp_face.get_key_point(detection, mp_face.FaceKeyPoint.NOSE_TIP).y * h)
                #print ('nx, ny: ', nx, ny)

                cv2.circle (image, (nx,ny), 5 ,(240,0,5), 3)
ozett commented 3 years ago

example skeletons: https://github.com/google/mediapipe/issues/1798#issuecomment-812593547 https://github.com/google/mediapipe/issues/1798#issuecomment-815954201

sgowroji commented 3 years ago

Hi @MuhamaadUsman, Did you get a chance to go through above comments. Thanks!

MuhamaadUsman commented 3 years ago

Yes I did, I will implement them soon

On Wed, Apr 21, 2021, 11:33 AM GowrojiSunil @.***> wrote:

Hi @MuhamaadUsman https://github.com/MuhamaadUsman, Did you get a chance to go through above comments. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/mediapipe/issues/1886#issuecomment-823813933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCL2SAPTNZ5UIRXZSX5WSTTJZWR3ANCNFSM425EROMA .

ozett commented 3 years ago

Hey, cool. I will come here tomorrow again to check. Too early?

sgowroji commented 3 years ago

Thanks for your update. We will close this issue now. Please feel free to reopen above issue if you have any further queries in the same context.

Leonnmarshall commented 2 years ago

e como pode fazer isso com java scrip