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

提升网站性能生活信息网站如何推广

提升网站性能,生活信息网站如何推广,太原建设厅网站,广东睿营建设有限公司网站ResNet50是一种深度残差网络#xff0c;50表示包含50层深度。该模型可以用于图像分类#xff0c;物体检测等。 现在用DeepStream测试ResNet50分类模型。 1 资源 模型地址#xff1a;https://github.com/onnx/models/blob/main/vision/classification/resnet/model/resnet…ResNet50是一种深度残差网络50表示包含50层深度。该模型可以用于图像分类物体检测等。 现在用DeepStream测试ResNet50分类模型。 1 资源 模型地址https://github.com/onnx/models/blob/main/vision/classification/resnet/model/resnet50-v2-7.onnx,模型信息详见https://github.com/onnx/models/tree/main/vision/classification/resnet。 label文件https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a TensorRT的python测试代码https://github.com/NVIDIA/TensorRT/blob/release/8.6/samples/python/introductory_parser_samples/onnx_resnet50.py nvinfer配置文件dstest_appsrc_config.txt [property] gpu-id0 labelfile-pathlabels.txt model-engine-fileresnet50.onnx_b1_gpu0_fp16.engine onnx-fileresnet50-v2-7.onnx infer-dims3;224;224 net-scale-factor0.01742919 offsets114.75;114.75;114.75 network-type1 input-object-min-width64 input-object-min-height64 model-color-format1 #gie-unique-id2 #operate-on-gie-id1 #operate-on-class-ids0 #classifier-async-mode1 #classifier-threshold0.51 #force-implicit-batch-dim1 batch-size1 network-mode1 num-detected-classes1000 interval0 gie-unique-id1 output-blob-names495 #scaling-filter0 #scaling-compute-hw0 cluster-mode2 is-classifier1 [class-attrs-all] pre-cluster-threshold0.2 topk20 nms-iou-threshold0.5   测试图片broom.JPG: 如果要用DeepStream跑这个模型只需要修改nvifner的配置文件。现在问题是怎么python处理转成nvinfer的配置文件。有几个注意的地方 # 归一化 Python版的归一化是按这个公式https://github.com/NVIDIA/TensorRT/blob/release/8.6/samples/python/introductory_parser_samples/onnx_resnet50.py#L73 # This particular ResNet50 model requires some preprocessing, specifically, mean normalization.         return (image_arr / 255.0 - 0.45) / 0.225 而nvinfer支持的是这个公式 y net scale factor*(x-mean) 这就需要把分子分母同乘个数最终变为y0.01742919 *  (x - 114.75). #第一个模型为分类模型 #nvinfer的大部分例子第一个模型都是检测模型这个例子第一个模型为分类模型。需要做如下设置 network-type1 #后处理 python例子中要对推理后的数据要做个argmax操作也就是从1000个结果里取可能性最大的。如果nvifner没有设parse-bbox-func-name, 那插件用的resnet的bbox解析函数刚好就是从可能性里找最大的。 2 运行 将模型resnet50-v2-7.onnxdstest_appsrc_config.txt测试图片放在一起后执行命令 gst-launch-1.0 filesrc locationbroom.JPG ! jpegdec ! videoconvert ! video/x-raw,formatI420 ! nvvideoconvert ! video/x-raw\(memory:NVMM\),formatNV12 ! mux.sink_0 nvstreammux namemux batch-size1 width1280 height720 ! nvinfer config-file-path./dstest_appsrc_config.txt ! nvvideoconvert ! video/x-raw\(memory:NVMM\),formatRGBA ! nvdsosd ! nvvideoconvert ! video/x-raw,formatI420 ! jpegenc ! filesink locationout.jpg 3 问题 执行命令后发现生成的图片也没有分类的字符串。 nvinfer插件和nvinfer底层库是开源改了源代码之后需要编译替换对应库。在/opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer/nvdsinfer_context_impl_output_parsing.cpp加点打印之后发现的到的分类是对的索引462在label文件里就是broom只是没有取到分类的标签字符串。打印如下 ...... probability:2.433594, m_ClassifierThreshold:0.000000 probability:1.642578, m_ClassifierThreshold:0.000000 fd,  attr.attributeValue:462 ...... nvinfer的label解析函数InferPostprocessor::parseLabelsFile要求文件是以分号相隔的而这个label不是的。所以解析不成nvinfer的代码是开源的用户可以修改这个函数。相关代码如下 NvDsInferStatus InferPostprocessor::parseLabelsFile(const std::string labelsFilePath) {     std::ifstream labels_file(labelsFilePath);     std::string delim{;};     if (!labels_file.is_open()) ......
http://wiki.neutronadmin.com/news/342508/

相关文章:

  • 一级a视网站 做爰片做采购 通常在什么网站看
  • 国家建设免费论文网站房地产新闻最新政策2022
  • 嘉兴网站开发中国建筑工程信息官网
  • 企业网站建设维护合同书wordpress怎么关注站点
  • 杭州宣传片制作公司广安网站seo
  • 做电商网站的感想wordpress 猜你喜欢
  • 许昌网站建设汉狮怎么样商品网站源码
  • 游戏网站建设成功案例wordpress 登录后页面空白
  • 郑州网站建设推荐美软科技关键词资源
  • 免费备案网站空间北京谁会做网站开发
  • 如何进行网站的宣传和推广深圳广告策划公司
  • 免费建设小学校网站怎样自己制作网站
  • 深圳网站建设公司团队网站综合营销方案设计
  • 郑州网站优化公司排名jsp网站开发目的及意义
  • 微网站建设哪里便宜服装网站建设平台
  • 大庆市建设局网站工程建设标准化
  • 网站建设公司十年乐云seo网站内部seo优化包括
  • 微信建微网站seo网站诊断
  • wordpress多站点好用吗彩票网站怎么做
  • 全球首个完全响应式网站自助建设平台在中国诞生网站制作课程介绍
  • 网站开发量鄞州区网站建设报价
  • 制作网页的常用软件网站的seo如何优化
  • 家用电脑可以做网站吗知名设计公司有哪些
  • 企业网站内容模块外贸人员招聘信息
  • 徐州网站建设xlec百度收录提交网址
  • 配资网站开发是什么意思企业电话卡
  • 学做网站能找到工作么js动效网站
  • 网站建设市场报告广西建筑工程有限责任公司
  • 做网站用什么后台动漫设计好学吗
  • 七牛云做网站centos卸载wordpress