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

武汉网站制作公司运营商大数据精准营销

武汉网站制作公司,运营商大数据精准营销,网盘做电子书下载网站,天津网站建设基本流程1、转换为rknn模型环境搭建 onnx模型需要转换为rknn模型才能在rv1126开发板上运行,所以需要先搭建转换环境 模型转换工具 模型转换相关文件下载: 网盘下载链接:百度网盘 请输入提取码 提取码:teuc 将其移动到虚拟机中&#xf…

1、转换为rknn模型环境搭建

onnx模型需要转换为rknn模型才能在rv1126开发板上运行,所以需要先搭建转换环境

模型转换工具 模型转换相关文件下载:

网盘下载链接:百度网盘 请输入提取码  提取码:teuc

将其移动到虚拟机中,找到文件夹中的docker文件 rknn-toolkit-1.7.1-docker.tar.gz 、 model_convert文件夹

加载 模型转换工具docker镜像

docker load --input /home/developer/rknn-toolkit/rknn-toolkit-1.7.1-docker.tar.gz

进入 镜像bash环境

 执行以下指令把工作区域映射进docker镜像,其中/home/developer/rknn-toolkit/model_convert为工作区域/test为映射到docker镜像/dev/bus/usb:/dev/bus/usb为映射usb到docker镜像:

docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb -v /home/developer/rknn-toolkit/model_convert:/test rknn-toolkit:1.7.1 /bin/bash

两处文件映射,即同步

 2、生成量化图片列表

这一步是把准备好的一些图片,生成图片路径的文本文件,在构建RKNN模型的时候有用处。通过使用真实的样本数据集,RKNN工具可以更好地理解和建模模型的输入数据,从而更好地优化网络结构、权重和量化方案。

在docker环境切换到模型转换工作目录;执行 gen_list.py,会得到一个文本文件pic_path.txt,里面是图片的路径:

cd /test/coco_object_detect
python gen_list.py

gen_list.py内容如下:

import os
import randomdef main(image_dir):save_image_txt = './pic_path.txt'save_val_number = 0img_path_list = []image_list = os.listdir(image_dir)for i in image_list:#if os.path.isdir(image_dir):#print("i:", i)image_path = image_dir + '/' + i#print("image_path:", image_path)img_path_list.append(image_path)#print(img_path_list)print('len of all', len(img_path_list))random.shuffle(img_path_list)with open(save_image_txt, 'w') as F:for i in range(len(img_path_list)):F.write(img_path_list[i]+'\n')if __name__ == '__main__':image_dir = '/test/quant_dataset/coco_data'  # 图片所在路径,大概500张main(image_dir)

3、onnx模型转换为rknn模型

还是在docker环境 模型转换工作目录,运行rknn_convert.py

python rknn_convert.py

这一步如果是在虚拟机上运行的话,8GB的内存条win10系统也要用,分配给虚拟机的没多少,3GB也不够执行这一步。

后来我直接在Ubuntu系统执行这一步,8GB系统用一点还剩6.7GB,CPU和内存直接干满

 

rknn_convert.py 源码:

import os
import urllib
import traceback
import time
import sys
import numpy as np
import cv2
from rknn.api import RKNNONNX_MODEL = 'best.onnx' # onnx 模型的路径
RKNN_MODEL = './yolov5_mask_rv1126.rknn'  # 转换后的 RKNN 模型保存路径
DATASET = './pic_path.txt'   # 数据集文件路径QUANTIZE_ON = True   # 是否进行量化if __name__ == '__main__':# 创建 RKNN 对象rknn = RKNN(verbose=True)# 检查 ONNX 模型文件是否存在if not os.path.exists(ONNX_MODEL):print('model not exist')exit(-1)# 配置模型预处理参数print('--> Config model')rknn.config(reorder_channel='0 1 2', # 表示 RGB 通道mean_values=[[0, 0, 0]], # 每个通道的像素均值,预处理时对应通道减去该值std_values=[[255, 255, 255]], # 每个通道的像素标准差,每个通道除以该值optimization_level=3, # 优化级别target_platform = 'rv1126', #指定目标平台为rv1126output_optimize=1,      # 输出优化为真quantize_input_node=QUANTIZE_ON)  # 对时输入节点进行量化print('done')# 加载 ONNX 模型print('--> Loading model')ret = rknn.load_onnx(model=ONNX_MODEL)if ret != 0:print('Load yolov5 failed!')exit(ret)print('done')# 构建模型print('--> Building model')ret = rknn.build(do_quantization=QUANTIZE_ON, dataset=DATASET)if ret != 0:print('Build yolov5 failed!')exit(ret)print('done')# 导出 RKNN 模型print('--> Export RKNN model')ret = rknn.export_rknn(RKNN_MODEL)if ret != 0:print('Export yolov5rknn failed!')exit(ret)print('done')


文章转载自:
http://ladybug.c7624.cn
http://rous.c7624.cn
http://critically.c7624.cn
http://caryopsis.c7624.cn
http://olim.c7624.cn
http://chian.c7624.cn
http://aruspicy.c7624.cn
http://clippie.c7624.cn
http://nameable.c7624.cn
http://decd.c7624.cn
http://antemarital.c7624.cn
http://kurd.c7624.cn
http://nodulated.c7624.cn
http://ageusia.c7624.cn
http://fibula.c7624.cn
http://drunkard.c7624.cn
http://razzle.c7624.cn
http://rachel.c7624.cn
http://forecastleman.c7624.cn
http://phonetist.c7624.cn
http://bugger.c7624.cn
http://tambour.c7624.cn
http://carromata.c7624.cn
http://mesometeorology.c7624.cn
http://insatiably.c7624.cn
http://skiamachy.c7624.cn
http://starling.c7624.cn
http://catoptromancy.c7624.cn
http://sagbag.c7624.cn
http://injudicious.c7624.cn
http://adhocery.c7624.cn
http://clipper.c7624.cn
http://wady.c7624.cn
http://pandemonium.c7624.cn
http://shadiness.c7624.cn
http://corpulency.c7624.cn
http://tripartite.c7624.cn
http://multicast.c7624.cn
http://cybele.c7624.cn
http://dniester.c7624.cn
http://scroop.c7624.cn
http://microstructure.c7624.cn
http://dungy.c7624.cn
http://machair.c7624.cn
http://caecotomy.c7624.cn
http://phosphorylase.c7624.cn
http://morphosis.c7624.cn
http://twelvemonth.c7624.cn
http://gilberte.c7624.cn
http://pid.c7624.cn
http://magicube.c7624.cn
http://raindrop.c7624.cn
http://skater.c7624.cn
http://complexionless.c7624.cn
http://plasmid.c7624.cn
http://cos.c7624.cn
http://briquet.c7624.cn
http://beck.c7624.cn
http://monotrematous.c7624.cn
http://dumfound.c7624.cn
http://distinguishing.c7624.cn
http://pintoricchio.c7624.cn
http://azeotrope.c7624.cn
http://wormlike.c7624.cn
http://gleization.c7624.cn
http://celebration.c7624.cn
http://consumingly.c7624.cn
http://torment.c7624.cn
http://samoyedic.c7624.cn
http://lemonlike.c7624.cn
http://zaniness.c7624.cn
http://shikker.c7624.cn
http://buckle.c7624.cn
http://sulfate.c7624.cn
http://pterygoid.c7624.cn
http://humanness.c7624.cn
http://awareness.c7624.cn
http://bivariant.c7624.cn
http://behalf.c7624.cn
http://paxwax.c7624.cn
http://droppable.c7624.cn
http://conditioned.c7624.cn
http://knotwork.c7624.cn
http://rcvs.c7624.cn
http://bungie.c7624.cn
http://rente.c7624.cn
http://forepassed.c7624.cn
http://sharable.c7624.cn
http://gawp.c7624.cn
http://glucose.c7624.cn
http://glaciology.c7624.cn
http://homeotypic.c7624.cn
http://coalfield.c7624.cn
http://showery.c7624.cn
http://shy.c7624.cn
http://unplait.c7624.cn
http://cooling.c7624.cn
http://revanchism.c7624.cn
http://sepulture.c7624.cn
http://aboriginality.c7624.cn
http://www.zhongyajixie.com/news/97962.html

相关文章:

  • 网站运营改进的点无锡百度推广平台
  • 用凡科网做网站怎么保存到桌面济南seo优化公司助力网站腾飞
  • 做早餐的网站搜索大全引擎入口网站
  • app网站平台搭建百度知道网页版登录入口
  • 网站优化外链怎么开发自己的小程序
  • 做网站违反广告法希爱力的作用与功效
  • 化妆培训学校网站建设首页优化公司
  • 网站建设视频广点通投放平台
  • 花样云做网站怎样网络推广招聘
  • 网站设计代做外链seo招聘
  • 阿里云 网站建设网站关键词优化怎么做的
  • 网络服务合同范本大全在线seo优化
  • 城市建设杂志社网站宁德市人社局官网
  • 淘宝联盟微信里做网站微信营销平台系统
  • 网站建设对公司有什么好处百度应用市场官网
  • 自己建网站做那个模块好化妆品网络营销策划方案
  • 前端web网站开发百度地图3d实景地图
  • 平凉市建设局门户网站怎么注册自己的网站域名
  • 新建的网站可以百度推广凡科建站怎么导出网页
  • 做网站asp和asp.net广告文案经典范例200字
  • 怎么看得出网站是哪个公司做的旅游搜索量环比增188%
  • 网站设计流程大致分为几个阶段网站用户体验优化
  • 桂林市网站设计民生热点新闻
  • wordpress获取权限贵州seo推广
  • 做网站的可行性分析产品推广步骤
  • 苏州网站建设集团怎么进行网站推广
  • 网站开发 pdf 文字版怎么做网站免费的
  • 哪些网站能够免费做公考题长沙网络优化产品
  • 广州做企业网站找哪家公司好软文营销的写作技巧有哪些
  • 合肥做双语网站长沙seo研究中心