Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esearch-seg

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esearch-seg

paddleseg models run on onnx

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-64.1%
Maintainers
0
Weekly downloads
 
Created
Source

eSearch-seg

本仓库是 eSearch的录屏人像识别依赖

基于 PaddleSeg

基于onnxruntime的 web runtime,使用 wasm 运行,未来可能使用 webgl 甚至是 webgpu。

模型需要转换为 onnx 才能使用:Paddle2ONNX在线转换

在 js 文件下使用 electron 进行调试(需要 HTML canvas,暂不支持纯 nodejs)

使用

npm i esearch-seg

web

import * as seg from "esearch-seg";

nodejs

const seg = require("esearch-seg");
await seg.init({
    segPath: "seg.onnx",
});

let img = document.createElement("img");
img.src = "data:image/png;base64,...";
img.onload = async () => {
    let canvas = document.createElement("canvas");
    canvas.width = img.width;
    canvas.height = img.height;
    canvas.getContext("2d").drawImage(img, 0, 0);
    seg.seg(canvas.getContext("2d").getImageData(0, 0, img.width, img.height))
        .then((data) => {})
        .catch((e) => {});
};

init type

{
    segPath: string;
    node?: boolean;
    dev?: boolean;
    ort?: typeof import("onnxruntime-web");

ocr type

seg(img: ImageData): Promise<ImageData> // 人像

Keywords

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc