FaceTracker | Real time deformable face tracking in C++ with OpenCV | Computer Vision library

 by   kylemcdonald C++ Version: Current License: MIT

kandi X-RAY | FaceTracker Summary

FaceTracker is a C++ library typically used in Artificial Intelligence, Computer Vision, Deep Learning, OpenCV applications. FaceTracker has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
FaceTracker is a library for deformable face tracking written in C++ using OpenCV 2, authored by Jason Saragih and maintained by Kyle McDonald. Any publications arising from the use of this software, including but not limited to academic journal and conference publications, technical reports and manuals, should cite the following work: J. M. Saragih, S. Lucey, and J. F. Cohn. Face Alignment through Subspace Constrained Mean-Shifts. International Conference of Computer Vision (ICCV), September, 2009.
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        FaceTracker has a medium active ecosystem.
                        summary
                        It has 985 star(s) with 364 fork(s). There are 117 watchers for this library.
                        summary
                        It had no major release in the last 6 months.
                        summary
                        There are 6 open issues and 41 have been closed. On average issues are closed in 207 days. There are 2 open pull requests and 0 closed requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of FaceTracker is current.
                        FaceTracker Support
                          Best in #Computer Vision
                            Average in #Computer Vision
                            FaceTracker Support
                              Best in #Computer Vision
                                Average in #Computer Vision

                                  kandi-Quality Quality

                                    summary
                                    FaceTracker has 0 bugs and 0 code smells.
                                    FaceTracker Quality
                                      Best in #Computer Vision
                                        Average in #Computer Vision
                                        FaceTracker Quality
                                          Best in #Computer Vision
                                            Average in #Computer Vision

                                              kandi-Security Security

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

                                                          kandi-License License

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

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        FaceTracker releases are not available. You will need to build from source code and install.
                                                                        summary
                                                                        Installation instructions, examples and code snippets are available.
                                                                        FaceTracker Reuse
                                                                          Best in #Computer Vision
                                                                            Average in #Computer Vision
                                                                            FaceTracker Reuse
                                                                              Best in #Computer Vision
                                                                                Average in #Computer Vision
                                                                                  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 Here
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  FaceTracker Key Features

                                                                                  Real time deformable face tracking in C++ with OpenCV 3.

                                                                                  FaceTracker Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for FaceTracker.
                                                                                  Community Discussions

                                                                                  Trending Discussions on FaceTracker

                                                                                  Sending a vector3 to script from patches is not working
                                                                                  chevron right
                                                                                  Can't get FaceTracker class to work on HoloLens 2
                                                                                  chevron right
                                                                                  Java equals() seemingly returns wrong bool value
                                                                                  chevron right
                                                                                  Can we track face emotional like happy, sad, angry in Spark AR?
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  Sending a vector3 to script from patches is not working
                                                                                  Asked 2020-Oct-23 at 10:21

                                                                                  So I'm making a ball bounce in spark AR with cannon.js. Everything was working fine until I wanted to get the position of the forehead from the facetracker via the patch editor to a script.

                                                                                  Error:

                                                                                      Error:Exception in HostFunction: valueOf() called on a Signal. This probably means that you are
                                                                                      trying to perform an arithmetic operation on a signal like +, -, *, etc. Use functions .add, .sub(), 
                                                                                      etc on the signal instead or .subscribeWithSnapshot() on an EventSource to get the signal's current value on a callback.
                                                                                  at ScalarSignal::valueOf (native)
                                                                                  {
                                                                                  "line": 4841,
                                                                                  "column": 19,
                                                                                  "sourceURL": "cannon.js"
                                                                                  }
                                                                                  

                                                                                  My patches that send the vector3 of the forehead to the script.

                                                                                  this piece of code is giving the error:

                                                                                  var pos = Patches.getVectorValue('HeadPos');
                                                                                  groundBody.position.set(pos);
                                                                                  

                                                                                  I sadly can't find anything online about sending a vector3 from the patches to a 'Working' value in the script, Does somebody know how to send a vector3 value ta a script and the use it as a value?

                                                                                  ANSWER

                                                                                  Answered 2020-Oct-23 at 10:21

                                                                                  I've found a selution when working with cannon.js. cannon.js has a kind of update function so you can use .pinLastValue() because it does this every frame in order to update the physics.

                                                                                  My code:

                                                                                  // Create time interval loop for cannon 
                                                                                  Time.setInterval(function (time) {
                                                                                      if (lastTime !== undefined) {
                                                                                          let dt = (time - lastTime) / 1000;
                                                                                          world.step(fixedTimeStep, dt, maxSubSteps)
                                                                                  
                                                                                       // Get the head position values from the patches
                                                                                       var headVal1 = Patches.getScalarValue("HeadPosX").pinLastValue();
                                                                                       var headVal2 = Patches.getScalarValue("HeadPosY").pinLastValue();
                                                                                       var headVal3 = Patches.getScalarValue("HeadPosZ").pinLastValue();
                                                                                  
                                                                                       // Set the position of the head hitbox to the headposition in the physics world
                                                                                       HeadBody.position.x = headVal1;
                                                                                       HeadBody.position.y = headVal2;
                                                                                       HeadBody.position.z = headVal3;
                                                                                     }
                                                                                  
                                                                                      lastTime = time
                                                                                  }, timeInterval);
                                                                                  

                                                                                  This code gets the x, y and z values individually from the patches where I send these values individually as well. I could have done it as a Vector3 from both sides as well, but I thought this looked nicer and made it easier to edit the values individually through the patches instead of packing it as a Vector3 again.

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

                                                                                  QUESTION

                                                                                  Can't get FaceTracker class to work on HoloLens 2
                                                                                  Asked 2020-Jul-14 at 11:23

                                                                                  I'm having trouble getting the FaceTracker Class to work on HoloLens 2. As soon as I try to detect the faces with ProcessNextFrameAsync Method I get an exception of the following kind:

                                                                                  System.Runtime.InteropServices.COMException (0x80004005): Unspecified error

                                                                                  This is only the first part of the error message, if more information is needed, I can add that.

                                                                                  See this for a minimal example.

                                                                                  public async void Start()
                                                                                  {
                                                                                      var selectedGroup = await FindCameraAsync();
                                                                                      await StartMediaCaptureAsync(selectedGroup);
                                                                                  }
                                                                                  
                                                                                  private async Task StartMediaCaptureAsync(MediaFrameSourceGroup sourceGroup)
                                                                                  {
                                                                                      faceTracker = await FaceTracker.CreateAsync();
                                                                                      this.mediaCapture = new MediaCapture();
                                                                                      await this.mediaCapture.InitializeAsync(settings);
                                                                                      this.frameProcessingTimer = ThreadPoolTimer.CreatePeriodicTimer(ProcessCurrentVideoFrameAsync, timerInterval);
                                                                                  }
                                                                                  
                                                                                  private async Task ProcessCurrentVideoFrameAsync()
                                                                                  {
                                                                                      const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
                                                                                      var deviceController = this.mediaCapture.VideoDeviceController;
                                                                                      this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
                                                                                      VideoFrame videoFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width (int)this.videoProperties.Height);
                                                                                  
                                                                                      IList detectedFaces;
                                                                                      try
                                                                                      {
                                                                                          detectedFaces = await faceTracker.ProcessNextFrameAsync(videoFrame);
                                                                                      }
                                                                                      catch (Exception e)
                                                                                      {
                                                                                          System.Diagnostics.Debug.WriteLine($"Failed with Exception: {e.ToString()}");
                                                                                          return;
                                                                                      }
                                                                                  
                                                                                      videoFrame.Dispose();
                                                                                  }
                                                                                  
                                                                                  1. i get a suitable camera with MediaFrameSourceKind.Color and MediaStreamType.VideoPreview with FindCameraAsync(). Which works fine in my opinion.
                                                                                  2. start MediaCapture and the FaceTracker within StartMediaCaptureAsync()
                                                                                  3. try to detect faces in ProcessCurrentVideoFrameAsync()

                                                                                  Here are the things I have tested and the information I have received:

                                                                                  • I have a picture in the format Nv12, PixelWidth 1504 and PixelHeigt 846
                                                                                  • the permissions in Unity are granted for Webcam, PicturesLibrary and Microphone
                                                                                  • the app is compiled with Il2CPP
                                                                                  • the message No capture devices are available. appears after starting the app. In other articles it was mentioned that the permission (Webcam or Microphone) is missing, which is not the case. But may be connected nonetheless.
                                                                                  • I used Track faces in a sequence of frames and Basic Face Tracking sample as reference

                                                                                  I am very grateful for every incentive and thought.

                                                                                  UPDATE 14. July 2020

                                                                                  I have just tried the FaceDetector on several individual images that were stored locally on the HoloLens 2. This works fine.

                                                                                  Even though FaceDetector and FaceTracker are not identical, they are very similar. So I guess that the problem is somehow related to MediaCapture.

                                                                                  Next I will try to capture an image with MediaCapture and process it with FaceDetector.

                                                                                  If anyone has any more ideas in the meantime, I would be grateful to hear them.

                                                                                  ANSWER

                                                                                  Answered 2020-Jul-14 at 03:29

                                                                                  This is an official sample show how to use the FaceTracker class to find human faces within a video stream: Basic face tracking sample. And in line 256, that is the main point to get a preview frame from the capture device.

                                                                                  However, base on your code, you have created a VideoFrame object and specified the properties and format to it, but you are missing invoke GetPreviewFrameAsync to convert the native webcam frame into the VideoFrame object.

                                                                                  You can try the following code to fix it:

                                                                                  private async Task ProcessCurrentVideoFrameAsync()
                                                                                  {
                                                                                      const BitmapPixelFormat InputPixelFormat = BitmapPixelFormat.Nv12;
                                                                                      var deviceController = this.mediaCapture.VideoDeviceController;
                                                                                      this.videoProperties = deviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
                                                                                      VideoFrame videoFrame = new VideoFrame(InputPixelFormat, (int)this.videoProperties.Width (int)this.videoProperties.Height);
                                                                                  
                                                                                  //add this line code.
                                                                                      await this.mediaCapture.GetPreviewFrameAsync(videoFrame);
                                                                                  

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

                                                                                  QUESTION

                                                                                  Java equals() seemingly returns wrong bool value
                                                                                  Asked 2020-Jun-05 at 22:04

                                                                                  So my app is saving the names of Bluetooth devices the user has connected to previously in SharedPreferences which is than compared to all of the names of currently paired devices so on opening the app can instantly connect to the said device. This is done by this piece of code:

                                                                                  sharedPreferences = getApplicationContext().getSharedPreferences("BtNames", MODE_PRIVATE);
                                                                                  keys = sharedPreferences.getAll();
                                                                                  for(BluetoothDevice device : pairedDevices) {
                                                                                                  try {
                                                                                                      for (Map.Entry entry : keys.entrySet()) {...}
                                                                                  

                                                                                  This loops through the paired devices and the entries of SharedPreferences whose value than is accessed by this code:

                                                                                  String device_name = device.getName();
                                                                                  String name = entry.getValue().toString();
                                                                                  

                                                                                  Now both of these work well and entry.getValue()... returns the exact names of the previously connected devices. The problem occurs when trying to compare the two Strings by:

                                                                                  device_name.equals(name)
                                                                                  

                                                                                  This returns false even though both of the Strings appear to be exact same when logged:

                                                                                  E/FaceTracker: EV3LO
                                                                                  E/FaceTracker: EV3LO
                                                                                  

                                                                                  I have already tried to replace all spaces with nothing but that didn't work either. Maybe I overlooked something but at the moment I don't really have a clue what's going wrong. Thanks in advance for answers.

                                                                                  ANSWER

                                                                                  Answered 2020-Jun-05 at 22:04

                                                                                  The problem is a non printable and non ASCII character at the end or the beginning of the string. Please try the following script:

                                                                                  name.replaceAll("\\P{Print}","");
                                                                                  

                                                                                  I hope it helpem and good luck if it didn't

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

                                                                                  QUESTION

                                                                                  Can we track face emotional like happy, sad, angry in Spark AR?
                                                                                  Asked 2020-Apr-13 at 16:45

                                                                                  i am newbie for Spark AR. I just learn the basic, and i wanna now that can we track face emotional like sad, happy, angry etc? Like a facetracker using javascript made by justadudewhohacks

                                                                                  ANSWER

                                                                                  Answered 2020-Apr-13 at 16:45

                                                                                  There are some Face Gestures that are supported by Spark such as happy, smiling, surprised, kissing, etc. See here: https://sparkar.facebook.com/ar-studio/learn/documentation/reference/classes/facegesturesmodule/

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

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

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install FaceTracker

                                                                                  These instructions are for compiling the code on OS X and Ubuntu, but it should be possible to compile on other platforms.
                                                                                  src (contains all source code)
                                                                                  model (contains a pre-trained tracking model)
                                                                                  bin (will contain the executable after building)

                                                                                  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
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit
                                                                                  CLONE
                                                                                • HTTPS

                                                                                  https://github.com/kylemcdonald/FaceTracker.git

                                                                                • CLI

                                                                                  gh repo clone kylemcdonald/FaceTracker

                                                                                • sshUrl

                                                                                  git@github.com:kylemcdonald/FaceTracker.git

                                                                                • Share this Page

                                                                                  share link

                                                                                  Reuse Pre-built Kits with FaceTracker

                                                                                  Consider Popular Computer Vision Libraries

                                                                                  opencv

                                                                                  by opencv

                                                                                  tesseract

                                                                                  by tesseract-ocr

                                                                                  tesseract.js

                                                                                  by naptha

                                                                                  Detectron

                                                                                  by facebookresearch

                                                                                  Try Top Libraries by kylemcdonald

                                                                                  FreeWifi

                                                                                  by kylemcdonaldPython

                                                                                  ofxFaceTracker

                                                                                  by kylemcdonaldC++

                                                                                  ofxCv

                                                                                  by kylemcdonaldC++

                                                                                  AudioNotebooks

                                                                                  by kylemcdonaldJupyter Notebook

                                                                                  Parametric-t-SNE

                                                                                  by kylemcdonaldJupyter Notebook

                                                                                  Compare Computer Vision Libraries with Highest Support

                                                                                  opencv

                                                                                  by opencv

                                                                                  picasso

                                                                                  by square

                                                                                  thumbor

                                                                                  by thumbor

                                                                                  albumentations

                                                                                  by albumentations-team

                                                                                  vision

                                                                                  by pytorch

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit