nodejs linux安装+try onnx on web(chrome)

nodejs安装版

nodejs绿色免安装Windows

下载zip并解压即可
  • 官网,Other Downloads,Previous Releases,download,下载zip,解压即可,2,064 个文件,485 个文件夹,占用空间83.4M

  • 如果想再其他路径直接运行node.exe,需要为其设置环境变量

linux系统nodejs安装

命令行安装

  • sudo apt-get install nodejs
  • sudo apt-get install npm

非命令行安装

清除缓存:npm cache clean -f
将项目中的node_modules文件夹以及package-lock.json文件删除
执行:npm install --registry=https://registry.npm.taobao.org重新拉取依赖
启动项目:npm run dev

web onnx

  • 本文复现了微软官方的web端onnx调用过程,结果如下:

在这里插入图片描述

download resources

  • https://onnxruntime.ai/docs/tutorials/web/classify-images-nextjs-github-template.html
https://github.com/microsoft/onnxjs/tree/masterhttps://github.com/microsoft/onnxjs/tree/master/examples/browser
https://musetransfer.com/s/xryqxipiz 请点击链接获取《无主题 - onnxjs-master.zip》, 有效期至2月27日
在这里插入图片描述-https://github.com/Microsoft/onnxjs-demo/tree/data/data/examples/models
https://github.com/microsoft/onnxjs-demohttps://musetransfer.com/s/t0lrmxuku 请点击链接获取《无主题 - onnxjs-demo-master.zip》, 有效期至2月27日
/home/pdd/CLionProjects/web/onnxjs-demo-master/public/resnet50v2.onnx
  • rename
    在这里插入图片描述
(base)$:~/CLionProjects/web/onnxjs-master/examples/browser/resnet50$ npm install http-server -g

added 39 packages, and audited 40 packages in 18s

10 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New major version of npm available! 8.19.2 -> 9.5.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.5.0
npm notice Run npm install -g npm@9.5.0 to update!
npm notice 
(base) $:~/CLionProjects/web/onnxjs-master/examples/browser/resnet50$ http-server .. -c-1 -p 3000
Starting up http-server, serving ..

http-server version: 14.1.1

http-server settings: 
CORS: disabled
Cache: -1 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:3000
  http://192.168.0.109:3000
Hit CTRL-C to stop the server

结果

在这里插入图片描述

参考与更多

在这里插入图片描述- Node 成功的主要因素之一是它广受欢迎的软件包管理器——npm,因为 npm 使 JavaScript 开发人员可以快速方便地共享软件包

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值