face-api | powered Face Detection & Rotation Tracking | Computer Vision library

 by   vladmandic HTML Version: 1.7.1 License: MIT

kandi X-RAY | face-api Summary

kandi X-RAY | face-api Summary

face-api is a HTML library typically used in Artificial Intelligence, Computer Vision, Tensorflow applications. face-api has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              face-api has a low active ecosystem.
              It has 428 star(s) with 84 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 99 have been closed. On average issues are closed in 3 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of face-api is 1.7.1

            kandi-Quality Quality

              face-api has no bugs reported.

            kandi-Security Security

              face-api has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              face-api is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              face-api releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of face-api
            Get all kandi verified functions for this library.

            face-api Key Features

            No Key Features are available at this moment for face-api.

            face-api Examples and Code Snippets

            No Code Snippets are available at this moment for face-api.

            Community Discussions

            QUESTION

            Unhandled Rejection (TypeError): Cannot set property 'innerHTML' of undefined
            Asked 2021-May-27 at 06:58

            I'm using ReactJs to execute face-api-js for face recognition. In the console log I'm getting the values but it is not displaying in the live video.

            Unhandled Rejection (TypeError): Cannot set property 'innerHTML' of undefined this is the error I am getting under the function handleVideoOnPlay

            I'm new to the react framework it would be great if someone helps me out.

            ...

            ANSWER

            Answered 2021-May-27 at 05:38

            Problem: Cannot set property 'innerHTML' of undefined
            Reason: canvasRef.current becomes undefined

            Before continuing, I found one thing, the line has Ref, it should be ref

            Now, I guess you should make use of useEffect() as follows

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

            QUESTION

            react, how to call a function inside then block before initializing it or any proper way?
            Asked 2021-May-13 at 12:11

            I've build an javascript function with face-api.js for my react component which will return/console me the width and height of face detector box. I tried console.log in few places it seems working fine till the models(face-recognition-model).

            But when I write async function for face detector to detect face and console. It gives me error-

            ...

            ANSWER

            Answered 2021-May-13 at 12:11

            You need to change the order of function declaration. You can not call const variables before they were declared.

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

            QUESTION

            FileNotFoundError: [WinError 2] The system cannot find the file specified but paths are correct
            Asked 2021-Apr-19 at 20:50

            I check 20 other posts of people that keep getting this error, and none of em helped me solve my problem.

            I am trying to load a file into a TorchNeuralNet, to use for face verification.

            ...

            ANSWER

            Answered 2021-Apr-19 at 20:50

            It was the parser also OpenFace doesnt work well with Windows. Tried some Docker stuff but didnt work. Transitioned to dlib and opencv and im making progress.

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

            QUESTION

            Capture Detected Face Square Only JS
            Asked 2021-Mar-26 at 19:42

            I'm running a face detection model via JS in the webcam, it recognises the face and draws the box correctly. How can I then go about saving the detected face only as an image locally to my computer?

            Im grateful for any help! Im stuck!

            The code (from face-api.js) is as follows:

            JavaScript

            ...

            ANSWER

            Answered 2021-Mar-26 at 19:42

            You have a canvas. You can save a canvas: How To Save Canvas As An Image With canvas.toDataURL()?

            Assuming detections is an array:

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

            QUESTION

            problem with importing @tensorflow/tfjs-node while working with face-api.js package (node.js)
            Asked 2021-Mar-21 at 08:25

            i use @tensorflow/tfjs-node package for face-api.js package to speed up things (as they said ) that is my code :

            ...

            ANSWER

            Answered 2021-Mar-21 at 08:25

            As explained in this github issue

            The version of face-api.js you are using is not compatible with tfjs 2.0+ or 3.0+, only obsolete 1.x. Why it worked before you added tfjs-node? because face-api.js actually includes bundled version of tfjs-core 1.x. Once you added tfjs-node, it overrode global tf namespace, but its a much newer version and not compatible.

            You must install obsolete tfjs-node 1.x OR follow the pointers they give to use a newer port of face-api.js that supports TF 2.0.

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

            QUESTION

            face-api.js Use face expression model on hidden video feed
            Asked 2021-Jan-18 at 20:25

            Just found out about the awesome face-api.js repo, and I'm having a great time using the face expressions API. Maybe because I was smiling too much (for the testing).

            Anyway, In my app, I want to check if the user is smiling but without displaying the camera video on the screen.

            For now, I can check if the user is smiling or not with a pretty good accuracy, but the video has to be on my screen.

            How can I remove the video from the screen?

            Here is the js code:

            ...

            ANSWER

            Answered 2021-Jan-18 at 20:25

            I'm here to answer my own question just in case someone needs it in the future.

            The obvious answer should be to add a "display: none;" to the video tag. However, this doesn't work somehow.

            Instead, I created the element in javascript, appended it to the DOM, and changed its display to "none", and it worked.

            Here is the code that made it work:

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

            QUESTION

            Error with face-api - Error: toNetInput - expected media to be of type HTMLImageElement
            Asked 2020-Nov-24 at 03:41

            My name is Gabriel and I'm using face-api.js to apply FaceRecognition on my final essay, on my way to graduate.

            With the objective of trying the face-api and understand how it works, I created the following test.js:

            ...

            ANSWER

            Answered 2020-Nov-24 at 03:41

            I did post an Issue to github Face-API page, and there I was able to found a solution, so, if anyone would like to see it: https://github.com/justadudewhohacks/face-api.js/issues/729 Thanks for your time!

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

            QUESTION

            Cannot read property 'length' of undefined in face-api.js react
            Asked 2020-Oct-15 at 23:07
            import React, { useRef, useState, useEffect } from 'react';
            import * as faceapi from 'face-api.js';
            
            
            function App() {
              const videoRef = useRef(null);
              const canvasRef = useRef(null);
              useEffect(() => {
                const loadModels = async () => {
                  try {
                    const MODEL_URL = '/models'
                    Promise.all([
                      faceapi.nets.tinyFaceDetector.loadFromUri(MODEL_URL),
                      faceapi.nets.faceLandmark68Net.loadFromUri(MODEL_URL),
                      faceapi.nets.faceRecognitionNet.loadFromUri(MODEL_URL),
                      faceapi.nets.faceExpressionNet.loadFromUri(MODEL_URL),
                    ]).then(startVideo())
                  } catch (error) {
                    console.error(error)
                  }
            
                }
                loadModels();
            
              }, [])
              const startVideo = async () => {
                try {
                  let stream = null;
                  stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
                  videoRef.current.srcObject = stream;
                } catch (error) {
                  console.error(error)
                }
              }
            
              const handleVideoOnPlay = () => {
                setInterval(async () => {
                  const detections = await faceapi.
                    detectAllFaces(videoRef.current, new faceapi.TinyFaceDetectorOptions())
                    .withFaceLandmarks()
                    .withFaceExpressions()
                }, 100)
              }
              return (
                
                  
                  
                
              );
            }
            
            export default App;
            
            ...

            ANSWER

            Answered 2020-Oct-15 at 23:07

            The erorr was videoRef.current was null, just need to wrap it in

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

            QUESTION

            Face API with node.js using Axios
            Asked 2020-Sep-21 at 02:06

            I'm using Azure's cognitive service Face API to analyze images. I'd gotten it working earlier using url links to images without issue, but I'm trying to get it working with local images. I'd found a question asked that's exactly what I'm looking for with a request.post, but I'm trying to get it working with axios. My code:

            ...

            ANSWER

            Answered 2020-Sep-21 at 02:06

            If you want to run Axios in the node environment, we should use Stream, Buffer as request body data. For more details, please refer to here.

            For example

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

            QUESTION

            face-api and tensorflow.js not working in browser
            Asked 2020-Aug-30 at 10:34

            I'm trying to run this example in the browser

            https://justadudewhohacks.github.io/face-api.js/docs/index.html#getting-started-browser

            Specifically this code here

            ...

            ANSWER

            Answered 2020-Aug-28 at 12:56

            So, the error you were talking about in the question is:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install face-api

            Simply include latest version of FaceAPI directly from a CDN in your HTML: (pick one, jsdelivr or unpkg).
            FaceAPI ships with several pre-build versions of the library:. Bundled TFJS can be used directly via export: faceapi.tf. Reason for additional nobundle version is if you want to include a specific version of TFJS and not rely on pre-packaged one. FaceAPI is compatible with TFJS 2.0+ and TFJS 3.0+. All versions include sourcemap.
            dist/face-api.js: IIFE format for client-side Browser execution with TFJS pre-bundled
            dist/face-api.esm.js: ESM format for client-side Browser execution with TFJS pre-bundled
            dist/face-api.esm-nobundle.js: ESM format for client-side Browser execution without TFJS pre-bundled
            dist/face-api.node.js: CommonJS format for server-side NodeJS execution without TFJS pre-bundled
            dist/face-api.node-gpu.js: CommonJS format for server-side NodeJS execution without TFJS pre-bundled and optimized for CUDA GPU acceleration
            If you want to do a full rebuild, either download npm module. or clone a git project.

            Support

            TutorialTypeDoc API Specification
            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/vladmandic/face-api.git

          • CLI

            gh repo clone vladmandic/face-api

          • sshUrl

            git@github.com:vladmandic/face-api.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