Skip to content

Blog

Release v0.8.6

We’ve updated all packages used internally to the latest versions. This release doesn’t introduce any API or logic changes, as well as updates within body tracking or image/video post-processing. Basically, only build system was updated: esbuild and rollup are bumped to the latest versions, C++ modules implementing heavy math computations switched to C++17 from C++14, and we’ve updated their native dependencies as well.

One can migrate from the previous version of the SDK without any code changes. All examples are updated to the 0.8.6 version. They can be found on the getting started page.

Release v0.8.5

To provide more efficient and optimized WASM modules that perform all heavy computations in body tracking pipelines we’ve switched to the newer version of the Emscripten SDK. More recent versions of Emscripten dropped support of ES2017 and now require some features from ES2020. Therefore, starting from this release we are bundling all packages of the SDK in ES2020 modules. Required ES2020 features are widely available across major browsers so there shouldn’t be any compatibility issues when switching to the newer ECMAScript.

Release v0.8.3

In this release we introduce the concept of priority score for tracking targets. During the detection phase of a tracking pipeline several regions of interest passing confidence threshold may be detected. Number of targets selected for further tracking is limited by computational resources of a user’s device. Web runtime can track only 1 target because of performance limitation of browsers, especially on mobile. By default region of interest having the highest confidence score is chosen for tracking.

We’ve added a set of utilities that make process of target selection more flexible and controllable outside of Engeenee SDK. Namely, processors now have additional optional parameter - rate function that evaluates measure of priority for detected regions of interest. Detections with higher rates will be considered first for further tracking. For example, these methods may guide selection of tracking targets to prioritize bigger or more centered RoIs, downweight score according to some rules. Default implementation forwards confidence score as rate. Targets with rate <= 0.0 will be completely ignored by tracking pipeline.

PoseProcessor can tune target selection using rateRoI() parameter. It is called for every detected target and returns its priority score. Tracking pipeline will sort RoIs by evaluated priority scores, filter out ones that have <= 0, and choose the top N (1 for web) RoIs for tracking. RoIs are usually defined in normalized coordinates, therefore callback has aspect ration as a parameter, so implementation can use it to calculate correct measures.

We provide a set of simple predefined priority measures that can be used as PoseParams.rateRoI:

As an example of custom priority measure that one can implement, this is the code of rateByRoI method:

const rateByRoI = (roi: BodyCircle, ratio: number) => {
// Primary axis (incline)
const axis: Coord2D = [
roi.top[0] - roi.center[0],
roi.top[1] - roi.center[1]];
// Correct aspect ratio
axis[0] *= ratio;
// Radius relative to image height
const r = Math.sqrt(axis[0] ** 2 + axis[1] ** 2);
// Unit length axis
axis[0] /= r;
axis[1] /= r;
// Ignore RoIs rotated more than acos(0.5)=60deg
const penaltyA = axis[1] >= -0.5 ? 1.5 + axis[1] : 0;
// Penalize score by size if r<=0.25 of image height
const penaltyR = 0.75 + Math.min(r, 0.25);
// Penalize score by center with factor 0.5 on the edge
const penaltyC: Coord2D = [
1 - 0.5 * Math.abs(roi.center[0] - 0.5),
1 - 0.5 * Math.max(0.5 - roi.center[1], 0)];
// Assume score >= 0.75 is 100% confident
const score = Math.min(roi.score / 0.75, 1.0)
// Rate detection
return score * penaltyR * penaltyC[0] * penaltyC[1] - penaltyA;
}

FaceProcessor can tune target selection using rateRoI() parameter. It is called for every detected target and returns its priority score. Tracking pipeline will sort RoIs by evaluated priority scores, filter out ones that have <= 0, and choose the top N (1 for web) RoIs for tracking. RoIs are usually defined in normalized coordinates, therefore callback has aspect ration as a parameter, so implementation can use it to calculate correct measures.

We provide a set of simple predefined priority measures that can be used as FaceParams.rateRoI:

As an example of custom priority measure that one can implement, this is the code of rateByRoI method:

const rateByRoI = (roi: FaceRect) => {
// Normalized height
const h = roi.box[1][1] - roi.box[0][1];
// Center
const center: Coord2D = [
0.5 * (roi.box[0][0] + roi.box[1][0]),
0.5 * (roi.box[0][1] + roi.box[1][1])];
// Penalize score by heigh if h<=0.5
const penaltyH = 0.5 + Math.min(h, 0.5);
// Penalize score by center with factor 0.5 on the edge
const penaltyC: Coord2D = [
1 - 0.5 * Math.abs(center[0] - 0.5),
1 - 0.5 * Math.abs(center[1] - 0.5)];
// Assume score >= 0.75 is 100% confident
const score = Math.min(roi.score / 0.75, 1.0)
// Rate detection
return score * penaltyH * penaltyC[0] * penaltyC[1];
}

Release v0.8.2

Babylon.js had an issue where setting rotation or rotationQuaterion on a camera in right-handed coordinate system actually sets the camera 180 degrees flipped from what is represented in the view matrix. You can read more in the description of corresponding PR fixing the issue. In Engeenee SDK we had a workaround for this. Now when issue is fixed we’ve rolled back this workaround.

The major downside is that compatibility between different versions of Engeenee SDK and Babylon.js became slightly more complicated with the current release. If you are using a version of Engeeneee prior to 0.8.2 please use Babylon.js version 8.9.1 or lower. Starting from version 0.8.2 the minimum compatible version of Babylon.js is 8.11.0.

Babylon.js is a peer dependency of Engeenee’s @geenee/bodyrenderers-babylon, the rule of thumb when updating the SDK is to switch to the minimum compatible version of Babylon.js first (the one stated in package.json of bodyrenderers-babylon), and then gradually update the renderer if newer features or fixes are required.

Release v0.8.1

With this release we are switching to WebGL2 in all stages of processing and rendering pipelines. Previously, processing and effect shaders of the Engeenee SDK where written in WebGL1 for better compatibility with older devices and browsers. Meanwhile, inference of neural networks and most rendering engines already heavily utilize modern WebGL2 features that are available in all browsers for at least 5 years. Therefore, we’ve decided to port rest of GPGPU and image processing to the newer graphics standard that is by the way already pretty old (=.

All shaders were re-written and porting process is very straightforward and simple. If you have custom shaders utilized in ShaderProgram or ShaderPlugin, please update the code to follow WebGL2 shader syntax. We recommend this guide that describes major differences between standards. Basically, one needs to make the next simple changes to a shader code:

  • Replace attribure -> in
  • In vertex shader, replace varying -> out
  • In fragment shader, replace varying -> in
  • Replace gl_FragColor with any out vec4 variable and assign to it
  • Use texture() instead of texture2D(), textureCube(), etc
  • ShaderProgram adds #version 300 es line automatically

For fast prototyping of simple UIs in demos and examples we are using very lightweight library of UI components developed internally. Gluon library is build on top of amazing VanJS - ultra-lightweight, zero-dependency, and unopinionated Reactive UI framework written in vanilla JavaScript and DOM. VanJS doesn’t rely on JSX or introduce any special syntax to compose UI components, therefore we don’t need any additional transpilers. For styling Gluon utilizes UnoCSS - fast and flexible atomic CSS engine.

With this release we are making Gluon library available for all users of the Engeenee SDK. Engeenee remains framework agnostic and doesn’t restrict choice of UI framework. We just think that very lightweight UI library having zero dependencies and very easy to pick up may be useful as a starting point for enthusiasts who would like to achieve the fastest performance possible, have closer to bare-metal experience and concentrate more on the most interesting parts: 3D, visuals, and interactivity.

This release includes the next minor changes and fixes:

  • Added HeadFitPlugin.setNode(), method that was missing after major refactoring.
  • All internal dependencies are updated to the latest versions.