小编Lyo*_* K.的帖子

反应中的 Tensorflow Automl 模型

我正在尝试将 tensorflow 模型从其原始 html 移动到 react 应用程序(使用 create-react-app 构建)。

我的 App.js 看起来像这样:

import logo from './logo.svg';
import * as tf from "@tensorflow/tfjs";
// import { loadImageclassification } from "@tensorflow/tfjs";
import './App.css';
import * as automl from "@tensorflow/tfjs-automl";
import * as modelJSON from './model.json';

function App() {

var loadFile = function(event) {
    var image = document.getElementById('output');
    image.src = URL.createObjectURL(event.target.files[0]);
  run();
};

async function run() {
  console.log(modelJSON);
        // const model = await tf.loadImageclassification('model.json');
        const model = await automl.loadImageClassification(modelJSON);
        const image = document.getElementById('output'); …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs tensorflow automl tensorflow.js

8
推荐指数
1
解决办法
440
查看次数

标签 统计

automl ×1

javascript ×1

reactjs ×1

tensorflow ×1

tensorflow.js ×1