**Important**: This version of Face-Api does NOT pre-package `TFJS` to allow for faster downloads (it's much smaller) as well as to allow user to choose version of TFJS to use (it's compatible with any `TFJS 2.0+`).
### 1. IIFE script
*Size: 936KB minified*
This is simplest way for usage within Browser
Simply download `dist/face-api.js`, include it in your `HTML` file & it's ready to use.
IIFE script auto-registers global namespace `faceapi` within Window object.
And if you want to access `TensorFlow/JS` classes directly, they are exported as `faceapi.tf`
### 2. ESM module
*Size: 164KB non-minified*
If you're using bundler *(such as rollup, webpack, esbuild)* to package your client application, you can import ESM version of FaceAPI which supports full tree shaking
Note that this version does NOT pre-package `TFJS`, so you'll need to include it before you import `FaceAPI`
You can use any version of `TFJS` 2.0+
```js
import * as tf from 'https://cdnjs.cloudflare.com/ajax/libs/tensorflow/2.6.0/tf.min.js'; // load directly from CDN
import * as faceapi from 'dist/face-api.esm.js';
```
*Experimental*:
You could use same syntax within your main `JS` file if it's imported with `<script type="module">`
```html
<scriptsrc="tf.min.js">
<scriptsrc="./index.js"type="module">
```
and then in `index.js`
```js
import * as tf from 'https://cdnjs.cloudflare.com/ajax/libs/tensorflow/2.6.0/tf.min.js'; // load directly from CDN
import * as faceapi from 'dist/face-api.esm.js';
```
### 3. NPM module
*Size: 45,104KB unpacked (including sources and pre-trained model weights)*
Simmilar to ESM module, but with full sources as it points to `build/src/index.js` instead