diff --git a/.gitignore b/.gitignore index 3c3629e..dd87e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +build diff --git a/README.md b/README.md index 5ea394e..9677aaf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Due to reduced code and changed build process, resulting bundle is about **>5x s **Imporant!**: This version of **face-api** does not embedd full version of **tfjs** to enable dynamic loading of different versions of tfjs as well as to enable reusability of tfjs for different purposes. *Load tfjs explicitly before loading face-api.* -For example as ESM script: +For example as a script: ```html @@ -40,7 +40,7 @@ For example as ESM script: ``` -or as NPM module: +or as a module using `require`: ```js # npm install @tensorflow/tfjs @vladmandic/face-api @@ -49,14 +49,28 @@ or as NPM module: const faceapi = require('@vladmandic/face-api'); ``` +or as a module using `import`: +(NodeJS requires `"type": "module"` inside `package.json` to support `import` statements) + +```js +import tf from '@tensorflow/tfjs'; +import faceapi from '@vladmandic/face-api'; +``` + ## Weights Pretrained models and their weights are includes in `./model`. ## Build -Both **`./build`** (used by `import` or `require`) and **`./dist`** (used by `