Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Tastenkunst/brfv4_javascript_examples

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
https://github.com/Tastenkunst/brfv4_javascript_examples

brfv4 detection emscripten face face-detection face-tracking javascript sdk tracking web

Last synced: 2 months ago
JSON representation

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.

Awesome Lists containing this project

README

        

## BRFv5 Released!

BRFv4 will be discontinued in 2020.

Check out the new BRFv5 JavaScript SDK here:

### [https://github.com/tastenkunst/brfv5-browser](https://github.com/tastenkunst/brfv5-browser)

## Beyond Reality Face SDK - v4.1.0 (BRFv4) - Readme

### What is BRFv4?

It is a real time face detection and tracking SDK. You put in image data (camera stream or single picture) and it outputs facial data.

![alt text](readme_img.jpg "BRFv4")

### Ready to try!

Read the EULA (eula.txt) carefully before using the SDK. Once you decide to use BRFv4 commercially, you will get a
separate license agreement, that you must agree to. You can try the SDK free of charge to evaluate if it fits your projects'
needs. Once you decided to use BRFv4 in your project, please contact us for a commercial license:

+ http://www.tastenkunst.com/#/contact

### Visit us online.

+ [Github](https://github.com/Tastenkunst)
+ [Demo](https://tastenkunst.github.io/brfv4_javascript_examples/)
+ [Docs / API](https://tastenkunst.github.io/brfv4_docs/)
+ [What can I do with it?](https://tastenkunst.github.io/brfv4_docs/what_can_i_do_with_it.html)
+ [Website](https://www.beyond-reality-face.com)
+ [Facebook](https://www.facebook.com/BeyondRealityFace)
+ [Twitter](https://twitter.com/tastenkunst)

### Getting started.

To test BRFv4 simply visit the Javascript demo site:

+ https://tastenkunst.github.io/brfv4_javascript_examples/

This page also includes all available packages for download.

### Which platforms does it support?

#### HTML5/Browser – Javascript (works in Chrome/Firefox/Edge/Opera/Safari 11)
Run the index.html on a local server.

#### iOS - ObjectiveC/C++
Open the Xcode project. Attach your iOS device and run the example app on your device.

#### Android - Java
Open the Android Studio project. Attach your Android device and run the example app on your device.

#### macOS - C++ utilizing OpenCV for camera access and drawing
Have [OpenCV](http://opencv.org/) brewed (opencv3) on your system. Open the Xcode project and just run it on your Mac.

#### Windows - C++ utilizing OpenCV for camera access and drawing
Good luck in trying to compile [OpenCV](http://opencv.org/) for your Windows. Update the Visual Studio (2017) project properties that mention
OpenCV. Then run the Release x64 target. Fingers crossed!

#### Adobe AIR - Actionscript 3 on Windows, macOS, iOS and Android
Use your preferred IDE. Add the src folder and the ANE itself to your class path and run the example class on your
desired device (not in a simulator). Unfortunately we had to discontinue Flash Player (SWF in browser) support.

### Technical overview

BRFv4 comes with the following components:

+ face detection - Finds faces (rectangles) in an image/camera stream
+ face tracking - Finds 68 facial landmarks/features
+ point tracking - Tracks points in a webcam stream

All available packages have roughly the same content and come with a set of examples to show SDK use cases.

### What image size does BRFv4 need?

You can input any image size.

Internally BRFv4 uses a DYNx480 (landscape) or 480xDYN (portrait) image for the analysis. So 480px is the base size that every other input size gets scaled to, eg.

landscape:

+ 640 x 480 -> 640 x 480 // fastest, no scaling
+ 1280 x 720 -> 854 x 480
+ 1920 x 1080 -> 854 x 480

portrait:

+ 480 x 640 -> 480 x 640 // fastest, no scaling
+ 720 x 1280 -> 480 x 854
+ 1080 x 1920 -> 480 x 854

BRFv4 scales the results up again, so you don't have to do that yourself.
All parameters named *size or *width are pixel values based on the actual image size.
eg. telling BRF what face sizes to initially detect:

```markdown
brfManager.setFaceDetectionParams(int minFaceSize, int maxFaceSize, int stepSize, int minMergeNeighbors);
```
If you work with a 640x480 camera stream, it would be something like this:
```markdown
brfManager.setFaceDetectionParams(144, 432, 12, 8);
```
Where as if you work with a 1280x720 camera stream, you will need something like this:
```markdown
brfManager.setFaceDetectionParams(216, 648, 12, 8);
```
In the examples we generalize that a bit:
```javascript
// We have either a landscape area (desktop), then choose height or
// we have a portrait area (mobile), then choose width as max face size.

var maxFaceSize = _faceDetectionRoi.height;

if(_faceDetectionRoi.width < _faceDetectionRoi.height) {
maxFaceSize = _faceDetectionRoi.width;
}

brfManager.setFaceDetectionParams(maxFaceSize * 0.30, maxFaceSize * 0.90, 12, 8);
```
More on that in the API, see link above.

### FAQ

Can I track other objects like hands or neck?
+ No, it is tracking faces only.

Can you increase the performance?
+ We could remove some calculations in a commercial version, if you want to, but this comes at the price of reduced accuracy.

Can you make the library smaller?
+ Usually the descriptor would be 80MB and more. It's already only 9MB for most platforms. So: We could go down in 1,5MB steps, but this will also massively decrease accuracy.
Once you bought a license you can choose which size you want to go with.

### Release notes

v4.1.0 - 11th July 2018

+ All: Changed 3D calculation model a bit. This might result in slightly different placement and rotationX.
+ Info: We started to work on BRFv5 (yeha!)

v4.0.1 - 09th November 2017

+ JS: Added: WASM export to Javascript SDK.
+ JS: Fix: Found a workaround for iOS 11 (in Safari) for starting the camera.
+ JS: Updated: CreateJS to v1.0.2 (easel) and v1.0.1 (preload).
+ JS: Updated: ThreeJS to r88.
+ Minor cleanups
+ Known issue: JS SDK is slow in Chrome 63 because of this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=768775

v4.0.0 - 20th June 2017

It's done! After over a year of development Tastenkunst is proud to announce the release of BRFv4.

+ Changed: Completely rewritten the C++ core: image handling, face detection and tracking algorithms etc.
+ Changed: Image data can now be of any site. BRFv4 will handle the scaling internally.
+ Changed: Point tracking and face tracking can now be done simultaneously.
+ Changed: Face tracking algorithm changed from ASM to ERT. This comes with an increased file size though (For JS up from 2MB to 10MB)
+ Added: Multi face tracking. It is now possible to track more than one face.
+ Added: Example project for native Android (Java, Android Studio project)
+ Added: Example project for macOS (C++, Xcode project, needs brewed OpenCV for camera handling and drawing)
+ Added: Example project for Windows (C++, Visual Studio 2017 project, needs OpenCV for camera handling and drawing)
+ Added: Adobe AIR native extension now supports Windows, macOS, iOS and Android.
+ Removed: Support for Flash Player (SWF in Browser).

### Licenses

Used Haar Cascade: haarcascade_frontalface_default.xml
```

```