Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
psyseg-test
Advanced tools
The Personify Segmentation JavaScript Software Development Kit (PsySeg JS SDK) is a library that utilizes our state-of-the-art machine learning models and algorithms to perform user segmentation and apply special effects (blur and replacement) on the back
The Personify Segmentation JavaScript Software Development Kit (PsySeg JS SDK) is a library that utilizes our state-of-the-art machine learning models and algorithms to perform user segmentation and apply special effects on the background.
This repository contains the logic and supported API for extracting user and applying virtual background.
Please install this npm package first via NodeJS as "npm i psyseg-js-sdk"
a. usage: define input's colorspace for converting to right format of SDK colorspace (works with RGBA only)
b. notice: currently, this feature is not supported. Input's colorspace is forced to RGBA format
a. usage: advanced configuration for customer about processing parameters
b. notice: currently, it has only "erode" parameter
c. return: PsySegExtraParams object
a. usage: define input / output size for user segmentation process. Example: user provide input frame (640 x 480),
SDK's output will have same size (640 x 480). This size is fixed at initial setup and don't change until stopping process.
b. return: PsySegSetupInfo object
c. parameter
a. usage: buffer data for processing. This SDK only work with buffer data type.
b. return: PsySeg buffer data object
c. parameter
a. usage: create PsySeg instance for managing buffer data and executing segmentation process.
b. notice: DNN model should be only loaded at first SDK initialization (init page).
When process is restarted, it is not neccessary to reloaded.
c. return: PsySeg internal instance
d. parameter
a. usage: extracting alpha mask that seperating persona and background
b. notice: alpha mask data is pushed directly into pOutAlpha buffer
c. return: true on success, false otherwise
d. parameter
a. usage: extracting alpha mask that seperating persona and background
b. notice: virtual background output data is pushed directly into pOutColor buffer
c. return: true on success, false otherwise
d. parameter
a. usage: extracting alpha mask that seperating persona and background
b. notice: virtual background output data is pushed directly into pOutColor buffer. This function applies
different approach with psy_seg_overlay_background(...)
c. return: true on success, false otherwise
d. parameter
a. usage: extracting alpha mask that seperating persona and background
b. notice: blurred background output data is pushed directly into pOutColor buffer.
c. return: true on success, false otherwise
d. parameter
a. usage: extracting alpha mask that seperating persona and background
b. notice: persona data is pushed directly into pOutColor buffer.
c. return: true on success, false otherwise
d. parameter
a. usage: destroy all related tensors and data buffers and close the PsySeg instance
b. notice: psy_seg_create(...) and psy_seg_destroy(...) must be used as a couple at initializing and stopping
for avoiding memory leak
Step 1: Adding header scripts (for wasm module) and import psyseg-js-sdk npm package
<!-- scripts are stored in our server -->
<script src='SDK/model/tflite.js' async></script>
<script src='SDK/wasm/psyseg.js' async></script>
import * as PsySeg from "psyseg-js-sdk"
Step 2: Create setup information and buffer data for input / output / background
<!-- Specification Data -->
segWidth = 320;
segHeight = 240;
<!-- Configure variables -->
<!-- Create setup information with size of input frame: width / height -->
pSetupInfo = PsySeg.PsySegSetupInfo(segWidth, segHeight);
<!-- Get background buffer if needed (only for overlay background function -->
pBackground = PsySeg.PsySegBuf(pSetupInfo.colorWidth, pSetupInfo.colorHeight, 4, null);
<!-- Input buffer including: width / height / channels / data -->
pInColor = PsySeg.PsySegBuf(pSetupInfo.colorWidth, pSetupInfo.colorHeight, 4, null);
<!-- Output buffer including: width / height / channels / data -->
pOutColor = PsySeg.PsySegBuf(pSetupInfo.colorWidth, pSetupInfo.colorHeight, 4, null);
<!-- Colorspace of input frame -->
colorSpace = PsySeg.ColorSpaceType().COLOR_SPACE_RGBA;
Step 3: Create PsySeg instance
<!-- Instance for managing package -->
<!-- First initialization, setting reload = true. Otherwise, setting reload = false -->
pPsySeg = await PsySeg.psy_seg_create(pSetupInfo, true);
Step 4: Loading background data and running overlay effects (example for overlay effects)
<!-- Add background data via createBackground(...) function -->
<!-- createBackground(...) is user-defined function that return PsySegBuf for background data -->
pBackground = await createBackground(document.getElementById("background").getAttribute("src"), segWidth, segHeight);
<!-- Get input frame from camera (webcame is user-defined camera object) -->
pInColor.data = webcam.inputFrame;
<!-- Overlay background -->
await PsySeg.psy_seg_overlay_background(pPsySeg, pInColor, pBackground, colorSpace, pOutColor)
.then(async (status) => {
<!-- status = true means that processing is successful -->
if (status) {
<!-- drawCanvas(...) is user-defined function for drawing canvas -->
await drawCanvas(pOutColor, "result");
} else {
console.log("Cannot get overlay background");
}
})
.catch(e => console.log("Cannot get overlay background due to " + e));
For getting more information, please contact PersonifyInc
FAQs
The Personify Segmentation JavaScript Software Development Kit (PsySeg JS SDK) is a library that utilizes our state-of-the-art machine learning models and algorithms to perform user segmentation and apply special effects (blur and replacement) on the back
The npm package psyseg-test receives a total of 0 weekly downloads. As such, psyseg-test popularity was classified as not popular.
We found that psyseg-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.