美文网首页
Tensorflow.js on fly

Tensorflow.js on fly

作者: yingshaoxo | 来源:发表于2018-07-07 02:38 被阅读19次

    Have a try

    0. Source come from

    https://js.tensorflow.org/tutorials/webcam-transfer-learning.html

    1. Installation

    After googled how to install nodejs and npm:

    git clone https://github.com/tensorflow/tfjs-examples
    cd tfjs-examples/webcam-transfer-learning
    yarn
    
    yarn watch
    

    Take a picture from webcamera

    vim index.html:

    <html>
    <body>
    
        <video autoplay playsinline muted id="webcam" width="224" height="224"></video>
    
        <script src="index.js"></script>
    
    </body>
    </html>
    

    vim index.js:

    import {Webcam} from './webcam';
    
    const webcam = new Webcam(document.getElementById('webcam'));
    
    async function init() {
      try {
        await webcam.setup();
      } catch (e) {
        console.log(e);
      }
    }
    
    init();
    
    yarn watch
    

    https://github.com/yingshaoxo/age-and-gender-detection-in-real-time-with-tensorflowjs

    相关文章

      网友评论

          本文标题:Tensorflow.js on fly

          本文链接:https://www.haomeiwen.com/subject/zzyiuftx.html