Files
FastDeploy/examples/vision/classification/paddleclas/web
yunyaoXYY c91e99b5f5 [Docs] Pick paddleclas fastdeploy docs from PaddleClas (#1654)
* Adjust folders structures in paddleclas

* remove useless files

* Update sophgo

* improve readme
2023-03-23 13:06:09 +08:00
..

MobileNet 前端部署示例

本节介绍部署PaddleClas的图像分类mobilenet模型在浏览器中运行以及@paddle-js-models/mobilenet npm包中的js接口。

1. 前端部署图像分类模型

图像分类模型web demo使用参考文档

2. MobileNet js接口

import * as mobilenet from "@paddle-js-models/mobilenet";
# mobilenet模型加载和初始化
await mobilenet.load()
# mobilenet模型执行预测并获得分类的类别
const res = await mobilenet.classify(img);
console.log(res);

load()函数参数

classify()函数参数

  • img(HTMLImageElement): 输入图像参数类型为HTMLImageElement。