Jeeliz FaceFilter Documentation
repository·master·Indexed 25 days ago
https://github.com/jeeliz/jeelizfacefilterA lightweight JavaScript/WebGL library for real-time face detection and tracking in augmented reality applications. Version 1.1.0 provides raw tracking data (position, scale, rotation) and mouth detection, compatible with 3D engines like Three.js, Babylon.js, and A-Frame, as well as Canvas2D and CSS3D. The library includes helpers for face extraction, resolution optimization, and head-controlled interactions, and supports multi-face tracking across various lighting conditions.
What's inside Jeeliz FaceFilter
- Jeeliz FaceFilter is a lightweight, framework-agnostic JavaScript/WebGL library designed for real-time face detection and tracking. It captures video via WebRTC and provides raw data (detection status, position, scale, and Euler rotation angles) to allow developers to overlay 3D content for augmented reality applications. It is designed to be robust across various lighting conditions and is mobile-friendly.
Core Features of Jeeliz FaceFilter
masterThe library provides the following capabilities:
- Face Detection & Tracking: Real-time detection and tracking of faces.
- Rotation Detection: Detects face rotation.
- Mouth Detection: Detects mouth opening.
- Multi-face Support: Detects and tracks multiple faces.
- Robustness: High performance across different lighting conditions.
- Video Quality: Supports HD video acquisition.
- Platform Support: Mobile-friendly and compatible with various 3D engines (THREE.JS, BABYLON.JS, A-FRAME) and APIs (CANVAS, CSS3D).
Install and setup gify
masterTo usegify, you must includejDataViewin your project, asgifyrelies on it for reading binary files fromArrayBuffers. Ensure you pull the latest version from thejDataViewrepository.Launch the development server
masterTo develop your own filters or view demos locally, you can use the provided minimalist HTTPS server.
Using Node.js:
npm install npm run devAfter running, access the demos at
https://127.0.0.1:8000/demos/threejs/cube/index.html. Note that your browser may show a "not secure" warning; you must click "Advanced" and then "Proceed" to access the local HTTPS site.Using Python 2:
python2 httpsServer.pyAccess via
https://localhost:4443.Use JeelizThreeHelper.js for Three.js integration
masterUse theJeelizThreeHelper.jshelper script when integrating JeelizFaceFilter with Three.js, specifically for scenarios like multiple face tracking with 3D objects.Join the Jeeliz Partner Network (JPN)
masterFreelance developers, software companies, or web agencies can join the Jeeliz Partner Network (JPN) to receive development service requests and premium support for integrating the Jeeliz library. Join by filling out the Google Form.Optimize hosting for Jeeliz FaceFilter
masterTo improve performance and loading times:
- Enable GZIP Compression: The neural network JSON file (
neuralNets/NN_DEFAULT.json) is large but highly compressible. Ensure your server has GZIP compression enabled for both.jsand.jsonfiles. - Preload the Neural Network: By default, the library loads the neural network via AJAX after
JEEFACEFILTER.init()and after the user grants camera permissions. You can speed up the initial experience by preloadingneuralNets/NN_DEFAULT.jsonusing a Service Worker or a rawXMLHttpRequestimmediately after the HTML page loads. This ensures the file is in the browser cache when the library requests it. - Use the CDN: You can use the hosted version of the library at
https://appstatic.jeeliz.com/faceFilter/jeelizFaceFilter.js.
- Enable GZIP Compression: The neural network JSON file (
Use HeadControls.js for head-controlled interactions
masterUse theHeadControls.jshelper script to implement head-controlled mechanics (e.g., controlling game characters like Pacman via head movement).Integrate with Unity
masterA Unity plugin is available to create face filters using Unity and export them for the web. This plugin is available on the Unity Asset Store as "Augmented Reality WebGL - Face Tracking Virtual Try On".Use JeelizFaceCut.js for face extraction and color correction
masterUse theJeelizFaceCut.jshelper to extract a 2D crop of the face from the video stream and apply color correction. This is useful for face replacement or face swap applications.Request FaceFilter development services
masterIf you need a reliable development service provider to build a face filter using this library, you can submit a FaceFilter development request form to be put in touch with a qualified partner.Install the THREE.JS Blender exporter in Blender
masterBecause the Blender exporter was removed from the core THREE.JS repository, you can manually install this version to use it in your Blender workflows.
- Copy the
io_threedirectory from this repository into your Blender scripts folder:<blender_path>/scripts/. - Restart Blender.
- Enable the exporter in
File > User Preferenceswithin Blender.
- Copy the