Giter VIP home page Giter VIP logo

esearch-seg's Introduction

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> // 人像

esearch-seg's People

Contributors

xushengfeng avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.