Giter VIP home page Giter VIP logo

Comments (5)

JingyuanZhang avatar JingyuanZhang commented on May 18, 2024

document.getElementById('photo') 返回的 dom 类型是什么?

from paddle.js.

realeve avatar realeve commented on May 18, 2024

@JingyuanZhang
image

按照这里的demo来实现的
https://github.com/PaddlePaddle/Paddle.js/blob/bde871f1064d2f5559be6a0cac23c0c17332f6cd/packages/paddlejs-core/README_cn.md

// Import @paddlejs/paddlejs-core
import { Runner } from '@paddlejs/paddlejs-core';
// Import the registered WebGL backend.
import '@paddlejs/paddlejs-backend-webgl';

const runner = new Runner({
    modelPath: '/model/mobilenetv2', // model path, e.g. http://xx.cc/path, http://xx.cc/path/model.json, /localModelDir/model.json, /localModelDir
    feedShape: { // input shape
        fw: 256,
        fh: 256
    },
    fill?: '#fff' // fill color when resize image, default value is #fff
});

// init runner
await runner.init();
// predict and get result
const res = await runner.predict(mediadata, callback?);

这里 没写 mediadata 到底是一个dom还是其它的什么类型,dom 是 canvas还是img,如果是数据的话是不是需要转到0-1的区间内。

from paddle.js.

JingyuanZhang avatar JingyuanZhang commented on May 18, 2024

media data 可以 HTMLImageElement | HTMLVideoElement | HTMLCanvasElement

from paddle.js.

realeve avatar realeve commented on May 18, 2024

按照上面这样,给的是 HTMLImageElement ,但结果好像没对。

from paddle.js.

JingyuanZhang avatar JingyuanZhang commented on May 18, 2024

你的模型可以上传一下吗?

from paddle.js.

Related Issues (20)

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.