YOLOv4剪枝【附代码】

2023-05-16

本项目只是负责把框架搭建起来,没有进行重训练的微调或者去研究应该剪哪里比较好,需要自己去研究

YOLOv4代码参考:Pytorch 搭建自己的YoloV4目标检测平台(Bubbliiiing 深度学习 教程)_哔哩哔哩_bilibili

Paper:Pruning Filters for Efficient ConvNets

 文字内容有点多,请耐心看完【当然直接用代码也可以】

目录

安装

导入包

模型的实例化(针对已经训练好的模型)

对于非单层卷积的通道剪枝(不用看3.1)

剪枝之前统计一下模型的参数量

1. setup strategy (L1 Norm) 计算每个通道的权重 

2.建立依赖图(与torch.jit很像) 

3.分情况(1.单个卷积进行剪枝 2.层进行剪枝)

3.1 单个卷积(会返回要剪枝的通道索引,这个通道是索引是根据L1正则得到的)

3.2 层剪枝(需要筛选出不需要剪枝的层,比如yolo需要把头部的预测部分取出来,这个是不需要剪枝的) 

预测部分

代码 


对于单层剪枝主要分以下步骤[怕自己翻译有差距,所以各位可自行翻译理解]:

1. For each filter F_{i,j} , calculate the sum of its absolute kernel weights s_{j}=\sum_{l=1}^{n_{i}}\sum \left | K_{l} \right |.

2. Sort the filters by s_{j} .

3. Prune m filters with the smallest sum values and their corresponding feature maps. The kernels in the next convolutional layer corresponding to the pruned feature maps are also removed.

4. A new kernel matrix is created for both the ith and i + 1th layers, and the remaining kernel weights are copied to the new model.

大致意思就说对于你要剪的滤波器(就是卷积了),计算每个通道权重绝对值之和,就是L1,将计算结果进行排序,然后用一个最小值(可以理解为一个阈值)和这些卷积核相关的特征层的m个通道进行剪枝,剪枝以后会生成一个新的卷积核,将原来卷积核内没有被剪的权重赋值给现在得到的新卷积核。

比如你的输入特征层Xi大小为hi,wi,c,c是通道数。卷积核的输入通道数是ni,这个ni=c,输出通道数为ni+1,现在你要在ni+1处剪掉一个通道F_{i,j}(图中蓝色部分),我们知道,卷积的时候,输出多少通道,那么下一个特征图Xi+1相应的也会得到相同数量的特征层,现在我们把一个通道移除了,那么相应的,得到的特征层通道数量上也会减少(即Xi+1中蓝色部分会移除)。然后再下一个卷积的输入通道数ni+1又会和Xi+1的通道数一样,所以该卷积核也会减少相应的一个通道维度。对一个卷积进行剪枝,那么就会影响到下一个卷积的维度变化。

单层剪枝 


多层剪枝(两种策略):

• Independent pruning determines which filters should be pruned at each layer independent of other layers.

• Greedy pruning accounts for the filters that have been removed in the previous layers. This strategy does not consider the kernels for the previously pruned feature maps while calculating the sum of absolute weights.

1. 独立剪枝:对每一层的滤波器(卷积核)决定是否剪枝与其他层无关

2.贪婪剪枝:考虑先前层中所移除的滤波器。在剪枝计算权重绝对值之和时,不需要考虑先前已剪枝的特征图所对应的核

对于策略1独立剪枝,核的绿色部分是计算输出通道绝对值之和时,不考虑之前移除的特征层的这一维度(蓝色部分),也就是只考虑绿色这一列通道之和(这里的个人理解:蓝色这一行在单层剪枝是直接去掉的,也就是图中黄色部分都没有了,但在多层的独立剪枝中,在ni+2方向上只把蓝色区域去除,但黄色的部分要保留),所以核内黄色区域权重保留!

在策略2的贪婪剪枝中,不去统计在特征层中准备剪掉的通道[即考虑先前层中移除的]【个人理解,就是这里又不考虑黄色部分了吧】【可以自己翻译理解下:The greedy pruning strategy does not count kernels for the already pruned feature maps.】

 多层剪枝


环境: 

显卡:英伟达1650

pytorch 1.7.0(低版本应该也是可以的)

torchvision 0.8.0

torch_pruning


安装

pip install torch_pruning

导入包

import torch_pruning as tp

模型的实例化(针对已经训练好的模型)

model = torch.load('权重路径') model.eval()

对于非单层卷积的通道剪枝(不用看3.1)

剪枝之前统计一下模型的参数量

num_params_before_pruning = tp.utils.count_params(model)

1. setup strategy (L1 Norm) 计算每个通道的权重 

strategy = tp.strategy.L1Strategy()

2.建立依赖图(与torch.jit很像) 

DG = tp.DependencyGraph() 
DG = DG.build_dependency(model, example_inputs=torch.randn(1, 3, input_size[0], input_size[1])) # input_size是网络的输入大小

3.分情况(1.单个卷积进行剪枝 2.层进行剪枝)

3.1 单个卷积(会返回要剪枝的通道索引,这个通道是索引是根据L1正则得到的)

pruning_idxs = strategy(model.conv1.weight, amount=0.4) # model.conv1.weigth是对特定的卷积进行剪枝,amount是剪枝率

将根据依赖图收集所有受影响的层,将它们传播到整个图上,然后提供一个PruningPlan正确修剪模型的方法。 

pruning_plan = DG.get_pruning_plan( model.conv1, tp.prune_conv, idxs=pruning_idxs ) pruning_plan.exec() 
torch.save(model, 'pru_model.pth')

3.2 层剪枝(需要筛选出不需要剪枝的层,比如yolo需要把头部的预测部分取出来,这个是不需要剪枝的) 

excluded_layers = list(model.model[-1].modules()) 
for m in model.modules(): 
    if isinstance(m, nn.Conv2d) and m not in excluded_layers: 
        pruning_plan = DG.get_pruning_plan(m,tp.prune_conv, idxs=strategy(m.weight, amount=0.4)) 
        print(pruning_plan) # 执行剪枝 pruning_plan.exec()

如果想看一下剪枝以后的参数,可以运行: 

num_params_after_pruning = tp.utils.count_params(model) 
print( " Params: %s => %s"%( num_params_before_pruning, num_params_after_pruning))

剪枝完以后模型的保存(不要用torch.save(model.state_dict(),...)) 

torch.save(model, 'pruning_model.pth')

在代码中的prunmodel.py是对yolov4剪枝代码

如果你的权重是用torch.save(model.state_dict())保存的,请重新加载模型后用torch.save(model)保存[或调用save_whole_model函数]

如果你需要对单独的一个卷积进行剪枝,可以调用Conv_pruning(模型权重路径[包含网络结构图]),然后在k处修改你要剪枝的某一个卷积

如果需要对某部分进行剪枝,可以调用layer_pruning()函数,included_layers是你想要剪枝的部分[我这里是对SPP后面的三个卷积剪枝,如果需要剪枝别的地方,需要修改list里面的参数,注意尽量不要对head部分剪枝]


预测部分


预测部分,将剪枝后的权重路径填写在pruning_yolo.py中的"model_path"处,默认是coco的类[因为剪枝后的模型中已经保存了图结构,所以预测的时候不需要在实例化模型]。
然后运行predict_pruning.py 可以修改mode,'predict'是预测图像,'video'是视频[默认打开自己摄像头]



我尝试了一下对主干剪枝,发现精度损失严重,大家想剪哪部分可以自己去尝试,我只是把框架给搭建起来方便大家的使用,对最终的效果不保证,需要自己去炼丹。
可以训练自己的模型,剪枝后应该对模型进行一个重训练的微调提升准确率,这部分代码我还没有加入进去,可以自己把剪枝后的权重放训练代码中微调一下就行。后期有时间会加入微调训练部分。  

 

剪枝后的预测结果 


在coco数据集上,剪枝前后的参数量输出如下:

Params: 64363101 => 60438323

正确的剪枝后会打印出以下信息【如果有类似的信息就是可以正常剪枝,如果没出现,说明你剪的不对】:

[ <DEP: prune_conv => prune_conv on conv2.2.conv (Conv2d(615, 512, kernel_size=(1, 1), stride=(1, 1), bias=False))>, Index=[1, 2, 3, 4, 7, 9, 15, 16, 17, 18, 23, 24, 35, 39, 42, 45, 46, 53, 54, 58, 62, 63, 65, 70, 73, 75, 81, 84, 88, 90, 97, 101, 102, 106, 109, 111, 112, 113, 116, 119, 124, 127, 132, 133, 135, 138, 140, 141, 143, 145, 148, 149, 150, 157, 159, 161, 163, 166, 168, 169, 170, 172, 174, 176, 177, 179, 180, 181, 182, 185, 186, 187, 189, 191, 193, 196, 200, 202, 207, 210, 211, 216, 217, 220, 222, 223, 225, 226, 228, 233, 234, 236, 238, 242, 243, 245, 246, 247, 248, 249, 251, 253, 254, 255, 256, 257, 266, 267, 270, 271, 279, 280, 284, 287, 288, 291, 295, 299, 301, 302, 305, 306, 307, 309, 311, 314, 316, 319, 325, 326, 328, 331, 333, 341, 342, 344, 345, 346, 348, 349, 352, 355, 356, 357, 361, 371, 372, 374, 375, 379, 381, 385, 388, 391, 394, 395, 399, 401, 403, 406, 408, 410, 414, 415, 418, 421, 425, 430, 432, 433, 434, 438, 439, 440, 444, 445, 448, 449, 452, 453, 461, 465, 467, 468, 469, 473, 475, 479, 480, 481, 482, 485, 487, 492, 493, 495, 497, 499, 504, 505, 507, 508, 510, 511], NumPruned=125460]
[ <DEP: prune_conv => prune_batchnorm on conv2.2.bn (BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True))>, Index=[1, 2, 3, 4, 7, 9, 15, 16, 17, 18, 23, 24, 35, 39, 42, 45, 46, 53, 54, 58, 62, 63, 65, 70, 73, 75, 81, 84, 88, 90, 97, 101, 102, 106, 109, 111, 112, 113, 116, 119, 124, 127, 132, 133, 135, 138, 140, 141, 143, 145, 148, 149, 150, 157, 159, 161, 163, 166, 168, 169, 170, 172, 174, 176, 177, 179, 180, 181, 182, 185, 186, 187, 189, 191, 193, 196, 200, 202, 207, 210, 211, 216, 217, 220, 222, 223, 225, 226, 228, 233, 234, 236, 238, 242, 243, 245, 246, 247, 248, 249, 251, 253, 254, 255, 256, 257, 266, 267, 270, 271, 279, 280, 284, 287, 288, 291, 295, 299, 301, 302, 305, 306, 307, 309, 311, 314, 316, 319, 325, 326, 328, 331, 333, 341, 342, 344, 345, 346, 348, 349, 352, 355, 356, 357, 361, 371, 372, 374, 375, 379, 381, 385, 388, 391, 394, 395, 399, 401, 403, 406, 408, 410, 414, 415, 418, 421, 425, 430, 432, 433, 434, 438, 439, 440, 444, 445, 448, 449, 452, 453, 461, 465, 467, 468, 469, 473, 475, 479, 480, 481, 482, 485, 487, 492, 493, 495, 497, 499, 504, 505, 507, 508, 510, 511], NumPruned=408]
[ <DEP: prune_batchnorm => _prune_elementwise_op on _ElementWiseOp()>, Index=[1, 2, 3, 4, 7, 9, 15, 16, 17, 18, 23, 24, 35, 39, 42, 45, 46, 53, 54, 58, 62, 63, 65, 70, 73, 75, 81, 84, 88, 90, 97, 101, 102, 106, 109, 111, 112, 113, 116, 119, 124, 127, 132, 133, 135, 138, 140, 141, 143, 145, 148, 149, 150, 157, 159, 161, 163, 166, 168, 169, 170, 172, 174, 176, 177, 179, 180, 181, 182, 185, 186, 187, 189, 191, 193, 196, 200, 202, 207, 210, 211, 216, 217, 220, 222, 223, 225, 226, 228, 233, 234, 236, 238, 242, 243, 245, 246, 247, 248, 249, 251, 253, 254, 255, 256, 257, 266, 267, 270, 271, 279, 280, 284, 287, 288, 291, 295, 299, 301, 302, 305, 306, 307, 309, 311, 314, 316, 319, 325, 326, 328, 331, 333, 341, 342, 344, 345, 346, 348, 349, 352, 355, 356, 357, 361, 371, 372, 374, 375, 379, 381, 385, 388, 391, 394, 395, 399, 401, 403, 406, 408, 410, 414, 415, 418, 421, 425, 430, 432, 433, 434, 438, 439, 440, 444, 445, 448, 449, 452, 453, 461, 465, 467, 468, 469, 473, 475, 479, 480, 481, 482, 485, 487, 492, 493, 495, 497, 499, 504, 505, 507, 508, 510, 511], NumPruned=0]
[ <DEP: _prune_elementwise_op => prune_related_conv on upsample1.upsample.0.conv (Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False))>, Index=[1, 2, 3, 4, 7, 9, 15, 16, 17, 18, 23, 24, 35, 39, 42, 45, 46, 53, 54, 58, 62, 63, 65, 70, 73, 75, 81, 84, 88, 90, 97, 101, 102, 106, 109, 111, 112, 113, 116, 119, 124, 127, 132, 133, 135, 138, 140, 141, 143, 145, 148, 149, 150, 157, 159, 161, 163, 166, 168, 169, 170, 172, 174, 176, 177, 179, 180, 181, 182, 185, 186, 187, 189, 191, 193, 196, 200, 202, 207, 210, 211, 216, 217, 220, 222, 223, 225, 226, 228, 233, 234, 236, 238, 242, 243, 245, 246, 247, 248, 249, 251, 253, 254, 255, 256, 257, 266, 267, 270, 271, 279, 280, 284, 287, 288, 291, 295, 299, 301, 302, 305, 306, 307, 309, 311, 314, 316, 319, 325, 326, 328, 331, 333, 341, 342, 344, 345, 346, 348, 349, 352, 355, 356, 357, 361, 371, 372, 374, 375, 379, 381, 385, 388, 391, 394, 395, 399, 401, 403, 406, 408, 410, 414, 415, 418, 421, 425, 430, 432, 433, 434, 438, 439, 440, 444, 445, 448, 449, 452, 453, 461, 465, 467, 468, 469, 473, 475, 479, 480, 481, 482, 485, 487, 492, 493, 495, 497, 499, 504, 505, 507, 508, 510, 511], NumPruned=52224]
[ <DEP: _prune_elementwise_op => _prune_concat on _ConcatOp([0, 512, 1024])>, Index=[513, 514, 515, 516, 519, 521, 527, 528, 529, 530, 535, 536, 547, 551, 554, 557, 558, 565, 566, 570, 574, 575, 577, 582, 585, 587, 593, 596, 600, 602, 609, 613, 614, 618, 621, 623, 624, 625, 628, 631, 636, 639, 644, 645, 647, 650, 652, 653, 655, 657, 660, 661, 662, 669, 671, 673, 675, 678, 680, 681, 682, 684, 686, 688, 689, 691, 692, 693, 694, 697, 698, 699, 701, 703, 705, 708, 712, 714, 719, 722, 723, 728, 729, 732, 734, 735, 737, 738, 740, 745, 746, 748, 750, 754, 755, 757, 758, 759, 760, 761, 763, 765, 766, 767, 768, 769, 778, 779, 782, 783, 791, 792, 796, 799, 800, 803, 807, 811, 813, 814, 817, 818, 819, 821, 823, 826, 828, 831, 837, 838, 840, 843, 845, 853, 854, 856, 857, 858, 860, 861, 864, 867, 868, 869, 873, 883, 884, 886, 887, 891, 893, 897, 900, 903, 906, 907, 911, 913, 915, 918, 920, 922, 926, 927, 930, 933, 937, 942, 944, 945, 946, 950, 951, 952, 956, 957, 960, 961, 964, 965, 973, 977, 979, 980, 981, 985, 987, 991, 992, 993, 994, 997, 999, 1004, 1005, 1007, 1009, 1011, 1016, 1017, 1019, 1020, 1022, 1023], NumPruned=0]
[ <DEP: _prune_concat => prune_related_conv on make_five_conv4.0.conv (Conv2d(1024, 512, kernel_size=(1, 1), stride=(1, 1), bias=False))>, Index=[513, 514, 515, 516, 519, 521, 527, 528, 529, 530, 535, 536, 547, 551, 554, 557, 558, 565, 566, 570, 574, 575, 577, 582, 585, 587, 593, 596, 600, 602, 609, 613, 614, 618, 621, 623, 624, 625, 628, 631, 636, 639, 644, 645, 647, 650, 652, 653, 655, 657, 660, 661, 662, 669, 671, 673, 675, 678, 680, 681, 682, 684, 686, 688, 689, 691, 692, 693, 694, 697, 698, 699, 701, 703, 705, 708, 712, 714, 719, 722, 723, 728, 729, 732, 734, 735, 737, 738, 740, 745, 746, 748, 750, 754, 755, 757, 758, 759, 760, 761, 763, 765, 766, 767, 768, 769, 778, 779, 782, 783, 791, 792, 796, 799, 800, 803, 807, 811, 813, 814, 817, 818, 819, 821, 823, 826, 828, 831, 837, 838, 840, 843, 845, 853, 854, 856, 857, 858, 860, 861, 864, 867, 868, 869, 873, 883, 884, 886, 887, 891, 893, 897, 900, 903, 906, 907, 911, 913, 915, 918, 920, 922, 926, 927, 930, 933, 937, 942, 944, 945, 946, 950, 951, 952, 956, 957, 960, 961, 964, 965, 973, 977, 979, 980, 981, 985, 987, 991, 992, 993, 994, 997, 999, 1004, 1005, 1007, 1009, 1011, 1016, 1017, 1019, 1020, 1022, 1023], NumPruned=104448]
282540 parameters will be pruned

代码 

2022.06.09已对项目更新:更新说明,对项目所有功能进行了整合,加入了剪枝后的训练部分,具体使用详见代码中的readme.md

代码地址:https://github.com/YINYIPENG-EN/Pruning_for_yolov4.git 

权重链接: 链接:百度云盘 提取码:yypn 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

YOLOv4剪枝【附代码】 的相关文章

  • Windows10下编译opencv以及yolov4、yolov4_cpp_dll.dll

    编译的安装顺序是 xff0c CUDA 43 CUDNN xff08 安装包与压缩包不要删除 xff0c 不要删除 xff0c 不要删除 xff0c 防止踩坑的后备 xff09 然后是VisualStdio xff0c 其次是OPENCV
  • DeepStream 部署 RTSP + scaled-yolov4 (tensorrtx)

    DeepStream应用程序将深度神经网络和其他复杂的处理任务引入到流处理管道中 xff0c 以实现对视频和其他传感器数据的近实时分析 从这些传感器中提取有意义的见解为提高运营效率和安全性创造了机会 例如 xff0c 摄像头是当前使用最多的
  • YOLOv4-pytorch训练自己的数据集

    YOLOv4 pytorch训练自己的数据集 YOLOv4 pytorch介绍环境配置运行环境安装依赖包 准备工作Git clone YOLOv4准备数据集下载PascalVOC MSCOCO 2017数据集准备自己的数据集 下载权重文件
  • c++调用yolov4模型进行目标检测-使用opencv4.4.0

    前言 最近刚出的opencv4 4 0也支持了yolov4 xff0c 便尝试用opencv调用yolov4进行检测 xff0c 做个记录 当然 xff0c yolov3 yolov4 tiny等也能调用 xff0c 只需修改加载的cfg和
  • YOLOV4与YOLOV3的区别

    YOLOV4与YOLOV3的区别 A big bliss的博客 CSDN博客 yolov3和yolov4的区别 首先 xff0c 先大概的说下二者之间的差别 xff1a 1 特征提取网络的不同 2 激活函数的不同 3 loss的不同 4 数
  • YOLOv4代码学习笔记一

    YOLOV4代码学习笔记一 YOLOV4简介CSPdarknet py学习 本文是对另一个博主的 睿智的目标检测30 Pytorch搭建YoloV4目标检测平台代码的学习 xff0c 由于我是cv新手 xff0c 很多东西不懂 xff0c
  • 从配置环境开始,跑通YOLOv4模型,测试成功!

    Windows10下跑通YOLOv4模型 xff0c 从配置环境开始 xff0c 测试成功 xff01 成功配置环境并跑通代码 xff0c 快乐记录ing xff08 参考来源 xff1a 博客地址 xff09 1 配置环境 1 1安装VS
  • YOLOv4在ROS-Melodic上的部署-libtorch(附源码,非Darknet)

    有关YOLOv4 LibTorch的部署可以看我的这篇博客 然后移植到ROS Melodic上就相对简单了 直接上GitHub链接吧 初版可能有点乱 xff0c 但是注释挺详细 xff0c 欢迎交流经验哈 2020 12 16 更新 YOL
  • yolov4-tiny使用jetson nano进行目标检测+tensorrt+CSI+USB摄像头检测

    软硬件版本 Jetson Nano 4G ubuntu 18 04 JP 4 5 1 CUDA 10 2 TensorRT 7 1 3 0 Python 3 6 一 下载源码 git clone https github com Alexe
  • PyTorch版YOLOv4训练自己的数据集---基于Google Colab

    colab简介 Google Colaboratory是谷歌开放的一款研究工具 xff0c 主要用于机器学习的开发和研究 工具优势 xff1a Google Colab最大的好处是给广大的AI开发者提供了免费的GPU使用 你可以在上面轻松地
  • YOLOv4剪枝【附代码】

    本项目只是负责把框架搭建起来 xff0c 没有进行重训练的微调或者去研究应该剪哪里比较好 xff0c 需要自己去研究 YOLOv4代码参考 xff1a Pytorch 搭建自己的YoloV4目标检测平台 xff08 Bubbliiiing
  • 一文读懂YOLOv5 与 YOLOv4

    作者 xff1a William 来源 xff1a 自动驾驶全栈工程师知乎专栏 链接 xff1a https www zhihu com people william hyin columns YOLO之父Joseph Redmon在今年年
  • Darknet YoloV4编译+训练(避免踩坑)

    AlexAB darknet yolov4编译 43 训练 时间间隔好几天今天来更新一下yolov4的训练 训练篇 在训练之前需要对大佬的源码进行编译本本机编译 xff0c 编译过程可查看下述链接 xff1a https blog csdn
  • c++ 调用yolov3-yolov4

    ifdef WIN32 define OPENCV define GPU endif include lt iostream gt include lt windows h gt include 34 yolo v2 class hpp 3
  • 睿智的目标检测29——Keras搭建YoloV4目标检测平台

    睿智的目标检测29 Keras搭建YoloV4目标检测平台 学习前言 什么是YOLOV4 代码下载 YOLOV4改进的部分 不完全 YOLOV4结构解析 1 主干特征提取网络Backbone 2 特征金字塔 3 YoloHead利用获得到的
  • 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5&Yolox核心基础知识完整讲解

    因为工作原因 项目中经常遇到目标检测的任务 因此对目标检测算法会经常使用和关注 比如Yolov3 Yolov4算法 Yolov5算法 Yolox算法 当然 实际项目中很多的第一步 也都是先进行目标检测任务 比如人脸识别 多目标追踪 REID
  • [yolov4]yolov4.weights

    版本 https github com AlexeyAB darknet 权重链接 yolov4 weights https 72k us file 26468910 439532813 提取密码 446792 yolov4 conv 13
  • Yolox_s可视化网络结构图

    Yolox共有七种网络结构 包含2种轻量级网络 和5种标准网络 轻量级网络 1 Yolox Nano可视化网络结构图 点击查看 2 Yolox Tiniy可视化网络结构图 点击查看 标准网络 1 Yolox s可视化网络结构图 点击查看 2
  • 【深度学习】基于Tensorflow的YOLOV4,已跑通程序,效果不错

    完整的程序放在这里了 已经跑通no bug 完整程序 实现效果 自己在colab上训练模型后得到的权重预测 试了几个场景 B站视频链接 识别校门口一号路 识别海盗狗 截图 部分代码如下 voc annotation py import os
  • yolov4训练自己的数据模型

    看了下yolov4的作者给的操作说明 链接如下 https github com AlexeyAB darknet how to compile on linux using make 有兴趣的可以去看看 总结起来 跟yolov3的操作方式

随机推荐

  • t265 通过mavros传递定位信息px4

    https github com thien94 vision to mavros 通过话题 mavros vision pose pose 向PX4发送位置数据 t265两种安装方式 xff1a USB口朝右镜头向前和向下安装 如需其它方
  • T265 VS D435i

  • px4_sitl_defult error

    span class token operator span Firmware span class token operator span Tools span class token operator span sitl gazebo
  • Intel RealSense D435i与IMU标定用于vins-fusion

    1 标定imu工具 mkdir span class token operator span p imu catkin ws span class token operator span src cd imu catkin ws span
  • PCL点云滤波处理D435i深度图用于octomap

    D435i直接输出的深度点云噪点太多经过滤波处理后再使用 直通滤波 保留或删除某一轴线特定范围内的点 xff0c 改变视野范围 pcl span class token operator span PassThrough span clas
  • ros编译过程中缺少各种依赖库的集合操作

    1 OpenGL All the OpenGL functionality tests failed You might need to modify the include and library search paths by edit
  • ROS发布自定义数组和数据

    主要使用std msgs数据结构 rosmsg show std msgs 自定义话题消息 1 新建msg文件 2 修改CMakeLists txt文件 3 修改package xml文件 4 生成对应头文件 5 编写发布者程序 6 编写接
  • 关于几个坐标系的关系NED ENU ROS

    几个坐标系转来转去 xff0c 时间一长又搞混了 px4使用的坐标系为NED xff08 北东地 xff09 坐标系或者FRD xff08 前右下 xff09 坐标系 然而mavros xff08 melodic版本 xff09 中常使用的
  • 使用Optitrack给px4提供定位

    Motive设置 打开View gt Data Streaming xff0c 确认OptiTrack Streaming Engine和VRPN Streaming Engine勾选Broadcast Frame Data 创建刚体 xf
  • 相关分析与回归分析

    相关与回归分析就是了解变量之间相关关系的统计方法 一 相关分析 具有相关关系的变量之间 xff0c 如果不区分原因和结果 xff0c 我们称之为相关分析 相关分析是看两个因素之间的相关性 xff0c 不需要确定哪个是自变量 xff0c 哪个
  • D435i运行vins-fusion性能提升

    1 mavros imu data mavros imu data raw选用区别 2 vins estimator odometry 话题转发给 mavros vision pose pose 3 关闭D435i的自动曝光 xff0c 设
  • 关于cartographer建立正确关系树的理解

    正确的TF关系map odom base link laser base link是固定在机器人本体上的坐标系 xff0c 通常选择飞控 其中map odom 的链接是由cartographer中lua文件配置完成的 map frame s
  • noetic ---lunar_devel melodic--indigo_devel

    对应关系
  • tf监听两个坐标系关系

    tf监听器 tf span class token operator span TransformListener listener span class token punctuation span span class token co
  • IDEA 2019 Tomcat日志中文乱码问题解决

    操作系统版本 Windows 10 1809 IDEA版本 2019 1 1 Tomcat版本 8 5 38 解决方法 修改conf logging properties配置文件 将其中的UTF 8改为GBK 1catalina org a
  • docker无法从docker hub下载镜像

    root 64 localhost docker docker info Containers 1 Running 1 Paused 0 Stopped 0 Images 2 Server Version 17 09 0 ce Storag
  • 下载yum源报错,无法解析mirrors.aliyun.com

    最近使用centOS安装Oracle xff0c 下载文件提示正在解析主机 mirrors aliyun com mirrors aliyun com 失败 xff1a 未知的名称或服务 解决这个问题简单 xff0c 需要在网络访问中改配置
  • 团队效率工具: 代码格式化之Clang-format

    介绍 平时团队进行合作的时候需要注意代码的格式 xff0c 虽然很难统一每个人的编码风格 xff0c 但是通过工具能够很好的管理代码格式 这里介绍下clang format xff0c 它是基于clang的一个命令行工具 xff0c 能够自
  • 关于头文件保护和变量重复定义的一点理解

    之前一直都有一个困惑 xff1a 既然头文件一般都有避免重复编译的预编译条件保护 xff0c 那为什么在头文件中定义全局变量就会出现重复定义的错误呢 xff1f 这个困惑持续了很久 xff0c 一直到最近才算大概理解 现记录于此 xff0c
  • YOLOv4剪枝【附代码】

    本项目只是负责把框架搭建起来 xff0c 没有进行重训练的微调或者去研究应该剪哪里比较好 xff0c 需要自己去研究 YOLOv4代码参考 xff1a Pytorch 搭建自己的YoloV4目标检测平台 xff08 Bubbliiiing