kandi background
Explore Kits

face_recognition | simplest facial recognition api for Python and the command | Computer Vision library

 by   ageitgey Python Version: v1.2.2 License: MIT

 by   ageitgey Python Version: v1.2.2 License: MIT

kandi X-RAY | face_recognition Summary

face_recognition is a Python library typically used in Artificial Intelligence, Computer Vision applications. face_recognition has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install face_recognition' or download it from GitHub, PyPI.
The world's simplest facial recognition api for Python and the command line
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • face_recognition has a medium active ecosystem.
  • It has 47024 star(s) with 12705 fork(s). There are 1585 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 674 open issues and 570 have been closed. On average issues are closed in 105 days. There are 21 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of face_recognition is v1.2.2
face_recognition Support
Best in #Computer Vision
Average in #Computer Vision
face_recognition Support
Best in #Computer Vision
Average in #Computer Vision

quality kandi Quality

  • face_recognition has 0 bugs and 0 code smells.
face_recognition Quality
Best in #Computer Vision
Average in #Computer Vision
face_recognition Quality
Best in #Computer Vision
Average in #Computer Vision

securitySecurity

  • face_recognition has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • face_recognition code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
face_recognition Security
Best in #Computer Vision
Average in #Computer Vision
face_recognition Security
Best in #Computer Vision
Average in #Computer Vision

license License

  • face_recognition is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
face_recognition License
Best in #Computer Vision
Average in #Computer Vision
face_recognition License
Best in #Computer Vision
Average in #Computer Vision

buildReuse

  • face_recognition releases are available to install and integrate.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • face_recognition saves you 458 person hours of effort in developing the same functionality from scratch.
  • It has 1081 lines of code, 61 functions and 24 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
face_recognition Reuse
Best in #Computer Vision
Average in #Computer Vision
face_recognition Reuse
Best in #Computer Vision
Average in #Computer Vision
Top functions reviewed by kandi - BETA

kandi has reviewed face_recognition and discovered the below as its top functions. This is intended to give you an instant insight into face_recognition implemented functionality, and help decide if they suit your requirements.

  • Batch image locations
    • Trim CSS to bounding box
    • Wrapper for _raw_face_detector
    • Convert a rect to CSS
  • Return a list of landmarks for a given face image
    • Wrapper for face detection
    • Returns a list of face locations for a given face image
    • Convert css to a rectangle
  • Process a single frame
    • Return the next worker id
    • Return the previous worker id
  • Test if an image is likely to be similar
    • Print results
  • Render an image
    • Detect face encoding
  • Compute face encodings
    • Calculate face locations
      • Compute the eye aspect ratio
        • Compare two faces
          • Trains the model
            • Scan for known people
              • Captures a video
                • Process images in a multiprocessing process
                  • Visualize prediction labels on an image
                    • Predict the face of a given image
                      • Run a test

                        Get all kandi verified functions for this library.

                        Get all kandi verified functions for this library.

                        face_recognition Key Features

                        Find all the faces that appear in a picture:. Get the locations and outlines of each person's eyes, nose, mouth and chin.

                        face_recognition Examples and Code Snippets

                        See all related Code Snippets

                        Community Discussions

                        Trending Discussions on face_recognition
                        • cannot append results to lists on multiprocessing
                        • "ERROR: CMake must be installed to build dlib" when installing face_recognition
                        • The called python file won't show again
                        • PyInstaller: How to call "shape_predictor_68_face_landmarks.dat" file with dlib.shape_predictor, while imported it with 'binaries'?
                        • Sorting a tensor list in ascending order
                        • problem in Installing (python Library) face_recognition on windows 10/11
                        • Celery/redis tasks don't always complete - not sure why or how to fit it
                        • is possible to face recognition with mediapipe in python
                        • "No CMAKE_CXX_COMPILER could be found" errror while deploying flask app on gcloud
                        • I am trying to load and split my data however i get TypeError: 'only integer scalar arrays can be converted to a scalar index'
                        Trending Discussions on face_recognition

                        QUESTION

                        cannot append results to lists on multiprocessing

                        Asked 2022-Mar-18 at 11:30

                        This below code will generate face encodings using multiprocessing , i can able to print the encoding but the problem is the knownEncodings ,knownNames ,no_faces ,error_in_image all are empty after the execution. I know its due to multiprocessing , but not sure how to mitigate this.

                        import face_recognition
                        from imutils import paths
                        from multiprocessing import Pool
                        import pickle
                        import cv2
                        import os,sys,time
                        
                        print("[INFO] quantifying faces...")
                        
                        img_folder_path=sys.argv[1]
                        
                        image_paths = list(paths.list_images(img_folder_path))
                        
                        knownEncodings = []
                        knownNames = []
                        no_faces = []
                        error_in_image =[]
                        
                        def create_encoding(imagePath):
                            print("[INFO] processing image...")
                            name = imagePath.split(os.path.sep)[-1]
                            image = cv2.imread(imagePath)
                            if image is None:
                                return
                            rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
                        
                            # detect the (x, y)-coordinates of the bounding boxes
                            # corresponding to each face in the input image
                            boxes = face_recognition.face_locations(rgb)
                        
                            # compute the facial embedding for the face
                            if len(boxes) != 0:
                                boxes = list(boxes[0])
                                encodings = face_recognition.face_encodings(image, [boxes])
                                for encoding in encodings:  
                                    knownEncodings.append(encoding)
                                    knownNames.append(name)
                                
                            else:
                                print("no face found" ,image_paths )
                                no_faces.append(image_paths )
                        
                        
                        
                        # loop over the image paths with multiprocessing
                        start_time = time.time()
                        
                        with Pool(8) as pool:
                            pool.map(create_encoding, image_paths )
                        
                        
                        end_time = time.time()
                        print(end_time - start_time)
                        
                        # dump the facial encodings + names to disk
                        print("[INFO] serializing encodings...")
                        data = {"encodings": knownEncodings, "names": knownNames, "no_faces":no_faces,"error_in_image":error_in_image}
                        
                        f_name = img_folder_path.replace("/","-")
                        print(f_name)
                        f = open(f"encodings_{f_name}.pickle", "wb")
                        f.write(pickle.dumps(data))
                        f.close()
                        

                        ANSWER

                        Answered 2022-Mar-18 at 10:46

                        You should not use list cross several processes. You can use multiprocessing.Queue or other Process safe models. How to use multiprocessing queue in Python?

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

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

                        Vulnerabilities

                        No vulnerabilities reported

                        Install face_recognition

                        First, make sure you have dlib already installed with Python bindings:.
                        How to install dlib from source on macOS or Ubuntu
                        Jetson Nano installation instructions Please follow the instructions in the article carefully. There is current a bug in the CUDA libraries on the Jetson Nano that will cause this library to fail silently if you don't follow the instructions in the article to comment out a line in dlib and recompile it.
                        Raspberry Pi 2+ installation instructions
                        @masoudr's Windows 10 installation guide (dlib + face_recognition)
                        Download the pre-configured VM image (for VMware Player or VirtualBox).

                        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
                        Reuse Solution Kits and Libraries Curated by Popular Use Cases
                        Explore Kits

                        Save this library and start creating your kit

                        Clone
                        • https://github.com/ageitgey/face_recognition.git

                        • gh repo clone ageitgey/face_recognition

                        • git@github.com:ageitgey/face_recognition.git

                        Share this Page

                        share link
                        Consider Popular Computer Vision Libraries
                        Try Top Libraries by ageitgey
                        Compare Computer Vision Libraries with Highest Support
                        Compare Computer Vision Libraries with Highest Quality
                        Compare Computer Vision Libraries with Highest Security
                        Compare Computer Vision Libraries with Permissive License
                        Compare Computer Vision Libraries with Highest Reuse
                        Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                        over 650 million Knowledge Items
                        Find more libraries
                        Reuse Solution Kits and Libraries Curated by Popular Use Cases
                        Explore Kits

                        Save this library and start creating your kit