- 博客(42)
- 收藏
- 关注
原创 rknn_convert的使用方法
这个配置文件包括了模型的名称、原始模型使用的框架、模型文件路径、输入输出信息、是否进行量化等详细信息。用户可以根据模型的特定需求编辑相应的配置文件。是RKNN-Toolkit2提供的一套常用模型转换工具,通过封装上述API接口,用户只需编辑模型对应的。通过使用上述命令和参数,用户可以将模型转换为RKNN格式,并将转换后的模型保存到指定的输出路径。配置文件,就可以通过指令转换模型。下面是一个参考的yml配置文件(
2025-04-03 14:52:44
890
原创 bn+conv融合,bn在前conv在后
这里还有个问题如果pad不为0的情况,那融合后的bias就不是Wconv*Bbn+Bconv,而是后面要接一个add,值为。就是后接个(t_beta - t_running_mean * t)过W的conv后的值。
2024-05-13 10:58:27
226
原创 txt文件读取为char字符串并存入.h头文件中
printf的字符串加入a[]中,可变成stringstream流进行文件写操作。txt转char字符串。
2023-08-18 17:45:37
178
原创 rk3588/rk356x/rv1109/rv1126/rv1106嵌入式交叉编译eigen库
1.下载eigen码源将,下载好的eigen文件夹拷贝到主目录下,进入到eigen文件夹中。将Eigen文件夹放入自己工程的include下(Eigen都是头文件直接链接就行)rk3588/rk356x/rv1109/rv1126交叉编译eigen库。创建脚本build-linux-rv1126.sh。在CMakeLists.txt中加入。后,会生成install文件夹,到。把Eigen文件夹copy出来。
2023-02-17 20:58:46
1002
原创 瑞芯微 rk3588 / rk356x 的rknn-toolkit2 / rknn2混合量化模型
瑞芯微 rk3588 / rk356x 的rknn-toolkit2 / rknn2混合量化模型
2022-11-09 21:33:22
3504
1
原创 rk3588/rk356x/rv1109/rv1126 live555移植+mpp编译 rtsp拉流
rk3588 rk356x rv1126/1109 mpp编译
2022-11-09 20:21:14
10969
9
原创 rk1126使用v4l2获取摄像头数据-踩坑日记
如果捕获视频的格式设置为V4L2_BUF_TYPE_VIDEO_CAPTURE,在rk1126板子上会报错,必须设为V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,rk的驱动默认设置的这个,最好还是查询再设置摄像头参数,不容易踩坑。
2022-10-13 10:34:40
2341
3
原创 torch在vgg16预训练模型上添加新的层
import torchfrom torch import nnimport torchvisionvgg16=torchvision.models.vgg16(pretrained=False)train_data=torchvision.datasets.CIFAR10('./data',train=True, transform=torchvision.transforms.ToTensor(),download=True)print(vgg16)此时输出vgg16结构VGG(
2022-04-04 11:09:25
3358
1
原创 使用CIOU作为YOLOv3的定位损失,focal loss作为分类损失
def box_ciou(b1, b2): """ 输入为: ---------- b1: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh b2: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh 返回为: ------- ciou: tensor, shape=(batch, feat_w, feat_h, a
2021-12-19 21:12:28
820
2
原创 tf获取节点的输出name onnx节点op修改
获取节点的输出nameOPS = tf.get_default_graph().get_operations() for op in OPS: for i in op.outputs: print(i.name,i.shape) OPS = tf.get_default_graph().get_operations() for op in OPS
2021-11-25 15:55:09
1928
原创 合并俩个xml里面的label
import cv2 import numpy as np import os,randomimport xml.dom.minidom# from PIL import Imageimport os,shutilimport mathdef xml_write(picname,info,img_len,img_height): xml_file = open((picname[0:-4]+'.xml'),'w') xml_file.write('<annotatio
2021-05-25 11:08:18
275
原创 tensorflow1提取网络中所有的名称
tf1提取网络中所有的名称tensor_name_list = [tensor.name for tensor in tf.get_default_graph().as_graph_def().node]for i in tensor_name_list: print(i)
2021-05-20 10:04:05
180
原创 python cv2改变图片亮度
https://blog.youkuaiyun.com/xiaogao_47/article/details/90261010
2021-05-19 20:55:27
5353
1
原创 遮住不需要的图片内容并且删除其label
遮住不需要的图片内容并且删除其labelimport cv2 import numpy as np import os,randomimport xml.dom.minidom# from PIL import Imageimport os,shutilimport mathdef xml_write(picname,info,img_len,img_height): xml_file = open((picname[0:-4]+'.xml'),'w') xml_file
2021-05-19 20:39:37
143
原创 图片数据扩增局部裁剪,xml文件自动跟随裁剪图片重新删减
import cv2 import numpy as np import osimport xml.dom.minidomfrom PIL import Imageimport randomdef write_xml(info,width,height,xml_dir='new/'): info1=info[0][:-4]+'.jpg' #write in xml file xml_file = open((xml_dir + info1[:-4]+'.xml').
2021-05-09 15:40:41
690
原创 随机复制xml文件与相对应的jpg文件
import cv2 import numpy as np import osimport xml.dom.minidomfrom PIL import Imageimport randomdef write_xml(info): info1=info[0][0:6]+'.jpg' img_dir='JPEGImages/' im = Image.open(img_dir+info1) width,height = im.size xml_dir=.
2021-05-07 14:41:02
264
1
原创 摄像头图片YUV420转化为RGB时常见的噪声模拟
摄像头图片转化时常见的噪声模拟,主要噪声:锯齿、高斯def pic_deal(img1,w=100,h=100,mean=0.23,var=0.001): # var1=0.01 # mean=0.01 img=img1.copy() img_shape=img.shape gray=cv2.cvtColor(img,cv2.COLOR_BGR2YUV) Y=cv2.resize(gray[...,0],(w,h)) Y=gasuss_noise(Y
2021-04-16 10:47:05
362
原创 对图像做倾斜/仿射处理,数据增强
对图像做倾斜/仿射处理,数据增强import numpy as npimport cv2,structdef affine(img, dx=30, dy=30): kk=0 img_h,img_w,_=img.shape if dx<0 or dy<0: kk=1 dx=abs(dx) dy=abs(dy) img=img[:,::-1,:] H, W, C = img.shape a
2021-04-14 15:17:19
240
原创 C++的友元函数
友元生活中你的家有客厅(Public),有你的卧室(Private)客厅所有来的客人都可以进去,但是你的卧室是私有的,也就是说只有你能进去,但是呢,你也可以允许你的好闺蜜好基友进去。在程序里,有些私有属性 也想让类外特殊的一些函数或者类进行访问,就需要用到友元的技术友元的目的就是让一个函数或者类 访问另一个类中私有成员友元的关键字为 friend友元的三种实现:全局函数做友元类做友元成员函数做友元以上是对友元函数的描述,可以知道友元函数可以访问class的private成员,但是友元函数
2020-05-14 18:53:18
274
原创 空指针访问成员函数
##空指针访问成员函数C++中空指针也是可以调用成员函数的,但是也要注意有没有用到this指针,如果用到this指针,需要加以判断保证代码的健壮性。若class类中是static静态成员变量/函数则即使Person * p = NULL调用也不会报错,因为static静态成员是和非静态成员放开存储,而且静态成员在计算机的存储中有且只有一份,采用共享的方式存在。#include<iostream>#include<algorithm>using namespace std;
2020-05-14 16:11:29
300
1
原创 tensorflow实现双向的逻辑判断
tensorflow实现双向d判断,例如1<a<0输出1import numpy as npimport matplotlib.pyplot as pltimport tensorflow as tfa=tf.constant([1.5 ,26.2,3.2,4.5,5.3,6.5,4])b=tf.ones_like(a)condition = tf.less(a, 2.2)...
2019-12-06 21:05:06
248
原创 wav文件音频采集频率44.1k降为8k
wav文件音频采集频率44.1k降为8kimport waveimport structdef save_wave_file(filename, data): wf1 = wave.open(filename, 'wb') wf1.setnchannels(1) wf1.setsampwidth(2)# 2byte 16bit wf1.setframerate...
2019-10-12 09:03:44
3028
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人