当前位置: 首页 > news >正文

php 网站目录结构成都网站建设思图佳

php 网站目录结构,成都网站建设思图佳,修改wordpress访问路径,十大品牌营销公司ESP32-S3部署yolox_nano进行目标检测 一、生成模型部署项目01 环境02 配置TVM包03 模型量化3.1预处理3.2 量化 04 生成项目 二、烧录程序 手上的是ESP32-S3-WROOM-1 N8R8芯片#xff0c;整个链路跑通了#xff0c;但是识别速度太慢了#xff0c;20秒一张图#xff0c;所以暂… ESP32-S3部署yolox_nano进行目标检测 一、生成模型部署项目01 环境02 配置TVM包03 模型量化3.1预处理3.2 量化 04 生成项目 二、烧录程序 手上的是ESP32-S3-WROOM-1 N8R8芯片整个链路跑通了但是识别速度太慢了20秒一张图所以暂时还没打算进一步优化程序。 一、生成模型部署项目 官方指导文件使用TVM自动生成模型部署项目 先下载onnx模型yolox_nano.onnx将下载好的yolox_nano.onnx放置在esp-dl/tutorial/evm_example路径下。 01 环境 ESP-IDF 5.0虚拟机Ubuntu 20.04python环境 02 配置TVM包 按官方文档下载完包后设置环境变量PYTHONPATH sudo vim ~/.bashrc # 在文件的最后添加以下行其中path-to-esp-dl更换为你的文件路径 export PYTHONPATH$PYTHONPATH:/path-to-esp-dl/tools/tvm/python03 模型量化 3.1预处理 ~/esp-dl $ cd tutorial/tvm_example ~/esp-dl/tutorial/tvm_example $ python -m onnxruntime.quantization.preprocess --input yolox_nano.onnx --output yolox_nano_opt.onnx3.2 量化 生成校准数据 import numpy as np import cv2 import os# 图片路径 path esp-dl/img/calib# 读取图片并将它们保存为numpy数组 images [] for filename in os.listdir(path):img cv2.imread(os.path.join(path, filename))img_resized cv2.resize(img, (416, 416))img_array np.transpose(img_resized, (2, 0, 1))img_array img_array / 255.0if img_array is not None:images.append(img_array)print(filename)# 将numpy数组保存为npy文件 np.save(esp-dl/tutorial/tvm_example/calib_416x416.npy, images)生成模型输入 import numpy as np import cv2 import ospath esp-dl/img/input.jpgimg cv2.imread(path) img_resized cv2.resize(img, (416, 416)) img_array np.transpose(img_resized, (2, 0, 1)) img_array img_array / 255.0 images [img_array]np.save(esp-dl/tutorial/tvm_example/input_416x416.npy, images)生成量化后的模型 ~/esp-dl/tutorial/tvm_example $ python ../../tools/tvm/esp_quantize_onnx.py --input_model yolox_nano_opt.onnx --output_model yolox_nano_quant.onnx --calibrate_dataset calib_416x416.npy Collecting tensor data and making histogram ... Finding optimal threshold for each tensor using entropy algorithm ... Number of tensors : 365 Number of histogram bins : 128 (The number may increase depends on the data it collects) Number of quantized bins : 128 WARNING:root:Please use QuantFormat.QDQ for activation type QInt8 and weight type QInt8. Or it will lead to bad performance on x64.04 生成项目 ~/esp-dl/tutorial/tvm_example $ python ../../tools/tvm/export_onnx_model.py --model_path yolox_nano_quant.onnx --img_path input_416x416.npy --target_chip esp32s3 --out_path . --template_path ../../tools/tvm/template_project_for_model/ Model Information: ------------------ Input Name: images Input Shape: (1, 3, 416, 416) Input DType: float Output Name: output Output Shape: (1, 3549, 85) Output DType: float [17:21:47] /home/gansichen/Workspace/projects/local/framework/tvm/src/relay/transforms/convert_layout.cc:99: Warning: Desired layout(s) not specified for op: nn.max_pool2d [17:21:47] /home/gansichen/Workspace/projects/local/framework/tvm/src/relay/transforms/convert_layout.cc:99: Warning: Desired layout(s) not specified for op: nn.max_pool2d [17:21:47] /home/gansichen/Workspace/projects/local/framework/tvm/src/relay/transforms/convert_layout.cc:99: Warning: Desired layout(s) not specified for op: nn.max_pool2d [17:21:47] /home/gansichen/Workspace/projects/local/framework/tvm/src/relay/transforms/convert_layout.cc:99: Warning: Desired layout(s) not specified for op: image.resize2d [17:21:47] /home/gansichen/Workspace/projects/local/framework/tvm/src/relay/transforms/convert_layout.cc:99: Warning: Desired layout(s) not specified for op: image.resize2d esp_dl_library_path: /home/zymidea/Desktop/esp32-cam/esp-dl generated project in: ./new_project二、烧录程序 烧录用的windows系统将虚拟机中生成的new_project文件夹复制到PC端打开ESP-IDF CMD cd new_preject idf.py set-target esp32s3 idf.py flash monitor这是按照官方的教程进行烧录但是模型太大会出现内存溢出esp32-template-project.elf section .dram0.bss will not fit in region dram0_0_seg region dram0_0_seg overflowed by 2141320 bytes。 ~/new_project $ idf.py size-components ... Total sizes: Used static IRAM: 61042 bytes ( 301198 remain, 16.9% used) .text size: 60015 bytes .vectors size: 1027 bytes Used stat D/IRAM: 2442376 bytes (-2096520 remain, 706.2% used) Overflow detected! .data size: 11088 bytes .bss size: 2431288 bytes Used Flash size : 3729295 bytes .text : 473467 bytes .rodata : 3255572 bytes Total image size: 3801425 bytes (.bin may be padded larger) 找到new_project/build/project_description.json中libtvm_model.a静态文件的源代码。 官方指导片外RAM 需要调整的是将模型的权重文件保存到flash并将模型的输出存放在PSRAM操作如下 // 打开/new_project/components/tvm_model/model/codegen/host/src/default_lib0.c// 代码最前面 // 增加一个头文件 #include E:/Espressif/frameworks/esp-idf-v5.0.4/components/esp_common/include/esp_attr.h// static struct global_const_workspace 将static改为const const struct global_const_workspace// 代码最后面 // __attribute__((section(.bss.noinit.tvm), aligned(16))) 将这句话注释掉 static EXT_RAM_BSS_ATTR uint8_t global_workspace[2422784]; // 增加宏EXT_RAM_BSS_ATTR// 打开/new_project/main/output_data.h const static _SECTION_ATTR_IMPL(.ext_ram.bss, __COUNTER__) __attribute__((aligned(16))) float output_data[42588] // 指定该数组存放到外部RAM的.ext_ram.bss段~/new_project $ idf.py menuconfig修改完毕S键保存Esc键退出。 修改/new_project/partitions.csv分区表中的factory的大小原本的3000多K存储模型权重不够将其增大点三个区的Offset都清空生成过程它会自动匹配。 所有的修改完毕后再重新再看一下各个RAM的使用情况 ~/new_project $ idf.py size-components ... Used static IRAM: 61042 bytes ( 301198 remain, 16.9% used).text size: 60015 bytes.vectors size: 1027 bytes Used stat D/IRAM: 19592 bytes ( 326264 remain, 5.7% used) .data size: 11088 bytes.bss size: 8504 bytes Used Flash size : 3729203 bytes .text : 473455 bytes .rodata : 3255492 bytes Total image size: 3801333 bytes (.bin may be padded larger) ...最后重新烧录就能运行成功了。 ~/new_project $ idf.py flash monitor
http://www.w-s-a.com/news/375347/

相关文章:

  • 微信公众号微网站建设专业网站建设出售
  • 怎么用wordpress建立自己的网站加强校园网站建设
  • 用什么做网站后台的织梦网站怎么上传
  • 怎么获取网站数据做统计百度快照推广有效果吗
  • 淘宝领卷网站什么做制造网站开发
  • 如何做com的网站网站建设投标书模板
  • 郑州网络营销网站优化网站技术方案怎么写
  • 济南市住房和城乡建设局网站wordpress mnews主题
  • ios开发网站app网站建设企业有哪些方面
  • 网站主页 优帮云深圳代做网站后台
  • app 与网站网站建设要做什么
  • 厦门国外网站建设公司郑州核酸点推vip服务
  • 免费网线seo外链怎么做
  • 宽带技术网网站wordpress widget hook
  • 山西省住房和城乡建设厅网站报名wordpress添加标签插件
  • 网站怎么自己做外贸网站案例
  • 做网站的优势公司网站怎么做站外链接
  • 海城网站制作建设精准营销的营销方式
  • 北京短视频拍摄公司重庆网站seo推广公司
  • 广州免费推广网站建设4399网页游戏大全
  • 网站的构架与组成建站公司兴田德润
  • php网站部署步骤邯郸哪有做网站的
  • 做设计什么设计比较好的网站南充市住房和城乡建设局考试网站
  • 郑州做系统集成的公司网站龙岩
  • 厦门SEO_厦门网站建设网络营销课程视频
  • vs 2015 网站开发开网店在线咨询
  • 前端如何优化网站性能大学学校类网站设计
  • 中国铁路建设投资公司网站熊学军中国it外包公司排名前50
  • 房产网站的建设广州推广排名
  • 湟源县网站建设wordpress删除未分类