face_landmark | simple method for face alignment | Machine Learning library

 by   610265158 Python Version: Current License: Apache-2.0

kandi X-RAY | face_landmark Summary

kandi X-RAY | face_landmark Summary

face_landmark is a Python library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Tensorflow applications. face_landmark has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However face_landmark build file is not available. You can download it from GitHub.

This is the tensorflow2.0 branch, if u need to work on tf1 switch to branch tf1, it still work. It is simple and flexible, trained with wingloss , multi task learning, also with data augmentation based on headpose and face attributes(eyes state and mouth state). And i suggest that you could try with another project,including face detect and keypoints, and some optimizations were made, u can check it there [pappa_pig_face_engine]. Contact me if u have problem about it. 2120140200@mail.nankai.edu.cn :). this gif is from github.com/610265158/Peppa_Pig_Face_Engine, but it is the same model : ).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              face_landmark has a low active ecosystem.
              It has 188 star(s) with 69 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 23 open issues and 27 have been closed. On average issues are closed in 2 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of face_landmark is current.

            kandi-Quality Quality

              face_landmark has 0 bugs and 0 code smells.

            kandi-Security Security

              face_landmark has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              face_landmark code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              face_landmark is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              face_landmark releases are not available. You will need to build from source code and install.
              face_landmark has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              face_landmark saves you 853 person hours of effort in developing the same functionality from scratch.
              It has 1955 lines of code, 120 functions and 27 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed face_landmark and discovered the below as its top functions. This is intended to give you an instant insight into face_landmark implemented functionality, and help decide if they suit your requirements.
            • Rotate image with given angle
            • Convert boxes to a set of boxes
            • Convert a set of points to a box
            • Rotate a label
            • Performs a training step
            • Compute the loss
            • Compute weight decay loss
            • Call the block
            • Shuffle a tensor
            • Perform custom loop
            • Calculate decay for given epoch
            • Wrapper for inference
            • Preprocess image
            • Randomize image with bboxes
            • Find boxes in an image
            • Calculates the loss based on the prediction
            • Compute thewing loss
            • Call the model
            • Parse an annotation file
            • Recursively gets the list of files in a directory
            • Performs a simple run
            • Visualize TFLite
            • Get a logger
            • Call the core function
            • Evaluate a single test step
            • Apply the projection function
            Get all kandi verified functions for this library.

            face_landmark Key Features

            No Key Features are available at this moment for face_landmark.

            face_landmark Examples and Code Snippets

            No Code Snippets are available at this moment for face_landmark.

            Community Discussions

            QUESTION

            AttributeError: module 'mediapipe.python.solutions.holistic' has no attribute 'FACE_CONNECTIONS'
            Asked 2022-Mar-23 at 18:26

            need help this is my code:

            ...

            ANSWER

            Answered 2021-Sep-08 at 15:12

            I just looked into the sourcecode at https://github.com/google/mediapipe/blob/master/mediapipe/python/solutions/holistic.py

            FACE_CONNECTIONS seems to be renamed/replaced by FACEMESH_TESSELATION.

            Just changing that name in the code should work.

            PS: If you want just the outlines of the face, it's now FACEMESH_CONTOURS

            Source https://stackoverflow.com/questions/69095372

            QUESTION

            I got this error pandas._libs.index.Int64Engine._check_type KeyError: 'class' when I try to skip a row when loading a csv tabulated data file
            Asked 2022-Jan-05 at 07:59
            import pandas as pd #pandas working with tabular data as dataframes
            from sklearn.model_selection import train_test_split #scikit-learn, building custom ML models
            
            from sklearn.pipeline import make_pipeline 
            from sklearn.preprocessing import StandardScaler 
            
            from sklearn.linear_model import LogisticRegression, RidgeClassifier
            from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
            
            #df = pd.read_csv('coords.csv')
            #df = pd.read_csv('coords.csv', header=None)
            #df = pd.read_csv('coords.csv', skiprows=[0])
            df = pd.read_csv('coords.csv', skiprows=[0], header=None)
            
            #df[df['class']=='Happy']
            
            X = df.drop('class', axis=1) # features
            y = df['class'] # target value
            
            X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1234)
            
            pipelines = {
                'lr':make_pipeline(StandardScaler(), LogisticRegression()),
                'rc':make_pipeline(StandardScaler(), RidgeClassifier()),
                'rf':make_pipeline(StandardScaler(), RandomForestClassifier()),
                'gb':make_pipeline(StandardScaler(), GradientBoostingClassifier()),
            }
            
            fit_models = {}
            
            for algo, pipeline in pipelines.items():
                model = pipeline.fit(X_train, y_train)
                fit_models[algo] = model
            fit_models['rc'].predict(X_test)
            
            ...

            ANSWER

            Answered 2022-Jan-05 at 07:59

            Base on your notepad, you can't just read it use pandas because not clearly what is the header of the data, and I assume this data just have 1 row (Because I don't see data from row of class and your just make the np array to a list can cause it). Example of correct csv: You can see clearly the first column indicate the data separate properly and can assume this data have more than 1 row. So difference from your csv. So you need to try pandas to save your data. For example your pose, face data have n - pair data, the easy way to add all of the data is we can use loop to add to dict:

            Source https://stackoverflow.com/questions/70587392

            QUESTION

            pandas - unnest list and show in csv each array value in a cell on column basis
            Asked 2021-Nov-21 at 23:34

            I'm preparing a dataset right now and I need it to have a certain format, such as this:

            Hand Pose No Seating Back Yes Seating Back No Seating Back Yes Seating Back No Seating Back Yes Seating Back

            However, currently it's producing

            0 Hand ['No', 'No', 'No', 'No', 'No', 'No', 'No'] Pose ['Seating Back', 'Seating Back', 'Seating Back']

            As you can see the values inside the array stored in one cell while I need it to be un-nested in a where one value occupies one cell.

            My code:

            ...

            ANSWER

            Answered 2021-Nov-21 at 20:13

            You're creating a Series instead of not a DataFrame. You want to create a DataFrame.

            Change

            Source https://stackoverflow.com/questions/70057631

            QUESTION

            Print list object in column using pandas
            Asked 2021-Nov-21 at 11:39

            I have code which produces a CSV by printing as shown below

            ...

            ANSWER

            Answered 2021-Nov-21 at 11:39

            QUESTION

            Is it possible to use face_landmark.tflite from Mediapipe to generate face mesh in Android independently?
            Asked 2021-Apr-15 at 12:13

            I'm working on a face tracking app (Android studio / Java) and I need to identify face landmarks. I'm interested using Mediapipe face mesh model. The problem is: I use Windows OS, and Mediapipe is not working on Windows OS.

            I have very basic knowledge in Tensorflow, Can anybody explain to me how can i use Mediapipe's face_landmark.tflite model to detect faces in images and generate face mesh in Android studio with Java independently without the whole Mediapipe framework?

            ...

            ANSWER

            Answered 2021-Apr-15 at 12:13

            You can try look into my notebook below for usage example in python. This only needs tflite model and does not require Mediapipe installation.

            https://nbviewer.jupyter.org/github/quickgrid/CodeLab/blob/master/tensorflow/MediaPipe_Face_Mesh_TFLite_Python_Direct_Inference.ipynb

            This is the output image,

            This should give a starting point to use android tflite interpreter to get face landmarks and draw them. It will require a face detector such as blazeface to output the face bounding box first.

            As I have not implemented this model in android yet I cannot say what else may be needed. Further details may be found in mediapipe face mesh codes. The notebook is based on this code,

            MediaPipe TensorflowLite Iris Model

            https://github.com/shortcipher3/stackoverflow/blob/master/mediapipe_iris_2d_landmarks.ipynb

            Further references,

            https://github.com/google/mediapipe/blob/master/mediapipe/modules/face_landmark/face_landmark.tflite

            https://google.github.io/mediapipe/solutions/face_mesh

            Model card with input, output details,

            https://drive.google.com/file/d/1QvwWNfFoweGVjsXF3DXzcrCnz-mx-Lha/view

            Alternate option

            Android ML Kit also has face landmarks with very good documentation and code example.

            https://developers.google.com/ml-kit/vision/face-detection

            https://developers.google.com/android/reference/com/google/mlkit/vision/face/package-summary

            Source https://stackoverflow.com/questions/67076361

            QUESTION

            Open Cv add jewelry image to captured face issue
            Asked 2021-Jan-29 at 07:31

            I have implemented the code where i am capturing the image and saving that image, After that i have another code which adds jewelry to that captured image, But i am facing issue while adding jewelry to captured face error==> "face_landmarks = face_landmarks_list[0] IndexError: list index out of range"
            Can some one help me with the solutions.

            ...

            ANSWER

            Answered 2021-Jan-29 at 07:31

            Error says the answer

            face_landmarks = face_landmarks_list[0]

            You need to check whether a single face is detected or not.

            Your second code, should start by checking the stored list length.

            If the length is greater than 0, meaning some faces are detected, then continue.

            Source https://stackoverflow.com/questions/65949313

            QUESTION

            unindent does not match any outer indentation level in face app
            Asked 2020-Dec-27 at 23:03

            I have here a script and i keep getting and indentation error but i cant figure out why

            ...

            ANSWER

            Answered 2020-Dec-27 at 16:18

            Answer
            The indentation issue is most likely caused by using both tabs and spaces for indentation. The PEP 8 formatting rules state to use spaces for indents. In certain IDEs you can set spaces to convert to tab, which can save you from the headaches of python syntax.

            References and Additional Links
            PEP 8: https://www.python.org/dev/peps/pep-0008/#indentation
            Similar Stack Overflow Question: IndentationError: unindent does not match any outer indentation level

            Source https://stackoverflow.com/questions/65467626

            QUESTION

            Face landmarks detection with dlib
            Asked 2020-Dec-10 at 23:44

            I have the following code:

            ...

            ANSWER

            Answered 2020-Dec-10 at 23:44

            face variable may contain multiple values, therefore you need to use predictor for each value.

            For instance:

            Source https://stackoverflow.com/questions/65243265

            QUESTION

            Better way to use this 2D array in Python
            Asked 2020-Oct-18 at 23:37

            I am working on a personal project to help me learn Python. I am working on drawing on an image using face_recognition library and PIL library. I am currently drawing "eyeliner" on a person's face by doing the following:

            ...

            ANSWER

            Answered 2020-Oct-18 at 23:37

            Now I'll be honest I have no idea if this is more efficient, and it's definitely more complicated, but I gave it a shot:

            Source https://stackoverflow.com/questions/64418373

            QUESTION

            AttributeError: 'bytes' object has no attribute 'read'
            Asked 2020-Sep-02 at 14:39

            I am working on this face recognition system.I have a folder with subfolders that has face images inside it. I am trying to loop through all the subfolders that consists of images and use my 'align_face' function that detects the face and crops and aligns all the images in subfolders. It then has to save all the aligned and cropped in another folder

            I have tried this:

            ...

            ANSWER

            Answered 2020-Sep-01 at 19:39

            The argument to align_face is the name of the file containing the image data, not the image data. So you don't need to open and read the data in your loop.

            Source https://stackoverflow.com/questions/63694246

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install face_landmark

            You can download it from GitHub.
            You can use face_landmark like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/610265158/face_landmark.git

          • CLI

            gh repo clone 610265158/face_landmark

          • sshUrl

            git@github.com:610265158/face_landmark.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link