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

网站建设及发展网站注册页面跳出怎么做

网站建设及发展,网站注册页面跳出怎么做,单位网站建设的目的,wordpress直接上传视频网站吗一直想做一点3D目标检测#xff0c;先来一篇单目3D目标检测Monodle#xff08;基于centernet的#xff09;#xff0c;训练代码参考官方【代码】#xff0c;这里只讲讲如何部署。 模型和完整仿真测试代码#xff0c;放在github上参考链接【模型和完整代码】。 1 模型训练…  一直想做一点3D目标检测先来一篇单目3D目标检测Monodle基于centernet的训练代码参考官方【代码】这里只讲讲如何部署。 模型和完整仿真测试代码放在github上参考链接【模型和完整代码】。 1 模型训练 训练参考官方代码 https://github.com/xinzhuma/monodle 2 导出onnx 如果按照官方代码导出的onnx后处理写起来比较复杂且后处理时耗比较长这里将后处理的部分代码放到模型中。原始官方导出的onnx模型如下图 本示例导出的onnx模型如下图这样导出便于写后处理代码模型后处理整个时耗也比较优 把centernet3d.py 文件拷贝一份命名为export_onnx.py并进行如下修改 export_onnx.py 修改后的完整代码 import os import cv2 import torch import torch.nn as nn import numpy as npfrom lib.backbones import dla from lib.backbones.dlaup import DLAUp from lib.backbones.hourglass import get_large_hourglass_net from lib.backbones.hourglass import load_pretrian_modelclass CenterNet3D(nn.Module):def __init__(self, backbonedla34, neckDLAUp, num_class3, downsample4):CenterNet for monocular 3D object detection.:param backbone: the backbone of pipeline, such as dla34.:param neck: the necks of detection, such as dla_up.:param downsample: the ratio of down sample. [4, 8, 16, 32]:param head_conv: the channels of convolution in head. default: 256assert downsample in [4, 8, 16, 32]super().__init__()self.heads {heatmap: num_class, offset_2d: 2, size_2d: 2, depth: 2, offset_3d: 2, size_3d: 3,heading: 24}self.backbone getattr(dla, backbone)(pretrainedTrue, return_levelsTrue)channels self.backbone.channels # channels list for feature maps generated by backboneself.first_level int(np.log2(downsample))scales [2 ** i for i in range(len(channels[self.first_level:]))]self.neck DLAUp(channels[self.first_level:], scales_listscales) # feature fusion [such as DLAup, FPN]self.heatmapmaxpool nn.MaxPool2d(kernel_size3, stride1, padding1)# initialize the head of pipeline, according to heads setting.for head in self.heads.keys():if head ! heatmap:output_channels self.heads[head]fc nn.Sequential(nn.Conv2d(channels[self.first_level], 256, kernel_size3, padding1, biasTrue),nn.ReLU(inplaceTrue),nn.Conv2d(256, output_channels, kernel_size1, stride1, padding0, biasTrue))else:output_channels self.heads[head]fc nn.Sequential(nn.Conv2d(channels[self.first_level], 256, kernel_size3, padding1, biasTrue),nn.ReLU(inplaceTrue),nn.Conv2d(256, output_channels, kernel_size1, stride1, padding0, biasTrue),nn.Sigmoid())# initializationif heatmap in head:fc[-2].bias.data.fill_(-2.19)else:self.fill_fc_weights(fc)self.__setattr__(head, fc)def forward(self, input):feat self.backbone(input)feat self.neck(feat[self.first_level:])ret {}for head in self.heads:ret[head] self.__getattr__(head)(feat)if head heatmap:heatmapmax self.heatmapmaxpool(ret[head])ret.update({heatmapmax: heatmapmax})return retdef fill_fc_weights(self, layers):for m in layers.modules():if isinstance(m, nn.Conv2d):nn.init.normal_(m.weight, std0.001)if m.bias is not None:nn.init.constant_(m.bias, 0)def export_onnx(model):print( onnx )dummy_input torch.randn(1, 3, 384, 1280)input_names [data]output_names [heatmap, offset_2d, size_2d, depth, offset_3d, size_3d, heading, heatmapmax]torch.onnx.export(model, dummy_input, ./Monodle_epoch_140.onnx, verboseFalse, input_namesinput_names,output_namesoutput_names, opset_version11)print( convert onnx Finished! .... )if __name__ __main__:print(This is main ...)CLASSES [Pedestrian, Car, Cyclist]net CenterNet3D(backbonedla34)checkpoint torch.load(./weights/checkpoint_epoch_140.pth,map_locationcpu)net.load_state_dict(checkpoint[model_state], strictTrue)net.eval()export_onnx(net)input torch.randn((1, 3, 1280, 384))print(input1:, input.shape, input.dtype)output net(input)print(output.keys())print(output[heatmap].shape)print(output[offset_2d].shape)print(output[size_2d].shape)print(output[depth].shape)print(output[offset_3d].shape)print(output[size_3d].shape)print(output[heading].shape) 运行 python export_onnx.py 生成.onn文件。 3 测试效果 官方pytorch 测试效果 onnx 测试效果 特别说明 由于官方代码的2d框是用3d框计算得到的而本博客是直接解码的模型预测出的2d框所以2d框有所出入。 4 onnx、rknn、horizon、tensorRT测试转完整代码 模型和完整仿真测试代码、测试图片参考【模型和完整代码】。
http://www.hkea.cn/news/14273412/

相关文章:

  • 网站做优化按点击收费wordpress登陆框
  • 站长工具 网站改版企业融资是什么意思
  • 灵溪网站建设php做网站需要什么技术
  • google年度关键词seo1视频发布会
  • 政务网站建设 发言设计个网站多少钱
  • 灰色系网站wordpress添加语系
  • 福州h5建站安徽建设厅网站首页
  • 长江工程建设局网站国家企业公示信息系统全国
  • 东莞哪家网站营销公司好制作网页时不能使用图案作为网页背景
  • 做手机网站要注意网站关于我们怎么做单页面模板
  • 郑州建设银行网站房贷网点在哪青柠视频免费版中文字幕
  • 怎么给网站做跳转哪些网站属于官网
  • 企业是如何做电子商务网站企业网站托管注意事项
  • 各国网站的域名做网站在后台如何添加链接
  • 深圳网站优化技巧网站一直没有收录
  • 发布软文是什么意思电子商务网站seo
  • c 做的网站大连比较好的的网站建设公司
  • wordpress多站点插件asp.net 网站开发实例
  • 做没用的网站企业网站模板 首页大图
  • 搜索引擎的网站优化WordPress 付费下载阅读
  • 厦门企业网站推广wordpress做app
  • 在线咨询免费海南快速seo排名优化
  • 怎么做网站网站赚钱wordpress 分辨 模版
  • 简历做的很棒的网站宿迁房产网签查询系统
  • 网站开发文档怎么写住房和城乡建设部办公厅
  • 中国优秀网站建设官网广州网站开发小程序
  • 个人外贸网站青海个人旅游网站建设
  • 济宁市环保局建设项目审批网站淘宝宝贝关键字优化
  • 嘉兴网站制作平台wordpress教程seo
  • 珠海网站建设哪个平台好杭州百度快照推广