Creates a module from Url
const frx = new Module("/path/to/face_tracker.zip.zip")
Creates a module from Request
const frx = new Module(new Request(
"/path/to/face_tracker.zip",
{ headers: { etag: "\"a610ceb58d4fa6b8b13dff520339ba88\"" } },
))
Creates a module from Blob
const file = $("#file-upload").files[0] // File is subclass of Blob
const frx = new Module(file)
Static
preloadCreates a module by preloading it from Url
Optional
options: LoadOptionsconst frx = await Module.preload("/path/to/face_tracker.zip")
// with a progress listener
const onProgress = ({ total, transferred }) => {
console.log(`Module is loaded on ${100 * transferred / total}%`)
}
const frx = await Module.preload("/path/to/face_tracker.zip", { onProgress })
Creates an array of modules by preloading them from a list of Urls
Optional
options: LoadOptionsconst [frx, background] = await Module.preload(["modules/face_tracker.zip", "modules/background.zip"])
// with a progress listener
const onProgress = (effectIndex, { total, transferred }) => {
console.log(`Module #${effectIndex} is loaded on ${100 * transferred / total}%`)
}
const [frx, background] = await Module.preload(
["effects/face_tracker.zip", "effects/background.zip"],
{ onProgress },
)
Auxiliary SDK module that enhances the Player with a feature like:
face_tracker.zip
- face tracking module, required for all the effects relying on face positionbackground.zip
- background segmentation module, required for all the Background effectshair.zip
- hair segmentation modulelips.zip
- lips segmentation moduleeyes.zip
- eyes segmentation moduleskin.zip
- face and neck skin segmentation modulebody.zip
- body segmentation module, opposite to background segmentationhands.zip
- hands segmentation module