Tensorflow.js on fly

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • This project was bootstrapped with Create React App. Belo...
    unspecx阅读 5,225评论 0 2
  • 原文链接:machinethink.net/blog/tensorflow-on-ios/ Before you ...
    dopami阅读 1,049评论 0 1
  • 我在北京待了好一段时间了,差不多5年了。 7、8月份是北京的雨季,大的小的,一阵一阵的,不讨厌,我反而觉得可爱。 ...
    霹雳蓝阅读 285评论 0 0
  • 一觉醒来 我想记下来这个梦 在梦里 大雷哥哥的小洋楼矗立在田野里 很扎眼 但是离后排我奶奶家还有其他人家的房子并不...
    小圆子freesun阅读 304评论 0 0
  • 独自坐在树荫下的长凳上,空气里是青草修剪过的味道。天气有些凉意了,多想让时光停留在那,永远的十五岁,穿棉布裙子倔强...
    kingki85阅读 210评论 0 0