自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 资源 (3)
  • 收藏
  • 关注

原创 如何入门Apollo自动驾驶框架?分享一点经验

作为程序员,写一天代码胜过看十天代码,做以下几件事可以快速度过刚开始最痛苦的一个月。1、接收一个图像topic,在图像上画一个框,再发布一个新的topic,在cyber_visualizer里面显示出来。这个过程可以学到知识点包括:Bazel编译、BUILD文件、proto通信、dag文件的编写。可以参考Apollo图像解压模块modules/drivers/tools/image_decompress/dag/image_decompress.dag,和说明文档docs/cyber/CyberRT_Q

2022-04-17 20:18:30 489 1

原创 CUDA复现opencv双线性插值resize

resize_gpu_float.cu#include "cuda_runtime.h"#include <cuda.h>#include <time.h>#include <vector>#include <opencv2/opencv.hpp>#include "opencv2/highgui.hpp"#include <iostream>#include <math.h>#include <chrono

2022-02-28 23:41:44 3557

原创 CUDA for循环计算递归函数,以勒让德多项式(Legendre polynomial)为例(3)

legendre_p.cu#include "cuda_runtime.h"#include <cuda.h>#include <stdlib.h>#include <iostream>#include <sys/time.h>#include <chrono>#define M 1000000 // M个点等分[-1, 1] #define N 100 // Legendre polynomial的阶数// htt

2022-02-12 12:00:34 745

原创 用sudo配置GPU MPS,docker里面没效果

# ====== 启动 =========export CUDA_VISIBLE_DEVICES=0 # 这里以GPU0为例,其他卡类似nvidia-smi -i 0 -c EXCLUSIVE_PROCESS # 让GPU0变为独享模式。nvidia-cuda-mps-control -d # 开启mps服务 # ====== 查看 =========ps -ef | grep mps # 启动成功后能看到相应的进程.

2022-02-11 22:35:29 1688

原创 CUDA for循环计算递归函数,以勒让德多项式(Legendre polynomial)为例(2)

#include "cuda_runtime.h"#include <cuda.h>#include <stdlib.h>#include <iostream>#include <sys/time.h>#include <chrono>#define M 1000000 // M个点等分[-1, 1] #define N 100 // Legendre polynomial的阶数// https://people.sc..

2022-02-10 22:40:23 562

原创 CUDA for循环计算递归函数,以勒让德多项式(Legendre polynomial)为例

#include "cuda_runtime.h"#include <cuda.h>#include <stdlib.h>#include <iostream>#include <sys/time.h>#include <chrono>// https://people.sc.fsu.edu/~jburkardt/cpp_src/legendre_polynomial/legendre_polynomial.cpp// https.

2022-02-09 22:38:46 872

原创 CUDA重写opencv最近邻插值,宽和高分别放大k倍

第一种方法:从global memory加载数据时coalesce#include "cuda_runtime.h"#include <cuda.h>#include <time.h>#include <vector>#include <opencv2/opencv.hpp>#include <opencv2/cudawarping.hpp>#include "opencv2/highgui.hpp"#include &l

2022-02-04 15:02:56 2697

原创 C++ 修改YAML文件的一个node节点

这是相机到激光的外参文件,我需要更改rotation的w,x,y,z,但是不改其他的nodeheader: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: velodyne128child_frame_id: right_fronttransform: translation: x: 0.51 y: 0.31 z: -0.10 rotation: w: 0.20917936691977584

2021-11-26 21:34:18 2070

原创 把CUDA和NVIDIA驱动卸载干净,并安装tensorrt

卸载cuda:cd /usr/local/cuda/bin/sudo ./uninstall_cuda_10.0.plcd /usr/local/sudo rm -r cuda-10.0/卸载驱动:cd /usr/bin/./nvidia-uninstall或者sudo apt-get --purge remove nvidia*参考:https://blog.csdn.net/qq_34245708/article/details/109341273https://b

2021-09-07 17:13:55 1011

原创 docker内不能使用sudo

报错:sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set新开一个terminal,显示所有的docker镜像:docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS .

2021-09-01 16:57:20 2468 2

原创 使用vscode编辑docker中的程序

首先在docker中安装相应插件,上面是local本地安装的插件,下面是CONTAINER AD_SENSOR_FUSION容器中安装的插件;然后,在ad_sensor_fusion上面右击,attach in new window把/root/删掉,输入/home/workspace/ad_sensor_fusion/选OK...

2021-08-26 08:36:20 666

原创 CCPD数据转成YOLO v5数据格式

import cv2import os#参考 https://blog.csdn.net/qq_36516958/article/details/114274778# https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data#2-create-labels# path = "/public/ccpd_green/test/"path = "/public/CCPD2019/ccpd_challenge/"for filena.

2021-08-04 17:57:13 2231 1

原创 Apollo中的世界坐标系、相机坐标系、图像坐标系、像素坐标系

Apollo点云感知中的世界坐标系是velodyne128激光的位置(蓝色坐标系,X轴表示障碍物水平距离);相机坐标系是相机的位置(红色坐标系,Z轴表示水平距离);此处有一个坑:modules/perception/data/params/front_6mm_extrinsics.yaml中的外参表示从相机坐标系到世界坐标系的旋转和平移,要想得到世界坐标系到相机坐标系的转换关系,得求逆。表示front_6mm_extrinsics.yaml中由四元数得到的旋转矩阵 ,表示旋转..

2021-07-30 11:03:14 1088

原创 摄像头感知的结果不能在cyber_visualizer里面显示(记录一次用VS code debug的过程)

问题是:cyber_monitor里面可以显示我自己写的通道信息,我自己的通道名称是"/apollo/perception/front_6mm/box ",这个通道里面的信息格式和"/apollo/sensor/camera/front_6mm/image"是一样的,但是cyber_visualizer不能显示我自己写的通道里面的图片。开始debug:首先,cyber_visualizer通过Add Image显示通道中的图片时,没有我自己写的通道"/apollo/perception/fron

2021-07-17 16:44:21 709

原创 Apollo Cyber RT创建一个新的组件component

参考链接:https://github.com/ApolloAuto/apollo/blob/master/docs/cyber/CyberRT_Quick_Start.mdhttps://github.com/ApolloAuto/apollo/blob/master/docs/cyber/CyberRT_API_for_Developers.md----------------------------把多张图片拼接在一起,在通道中输出-------------------------在/

2021-07-06 14:04:09 604

原创 Apollo v5.5视觉感知流程

以下文件都在/modules/perception/目录下。mainboard加载/perception/production/dag/dag_streaming_perception_camera.dag ,fusion_camera_detection_component.pb.txt为配置文件,进入/onboard/component/找类名为FusionCameraDetectionComponent的源文件。Init()初始化参数;OnReceiveImage(const std::s

2021-05-21 19:36:44 941

原创 Apollo视觉感知跑起来

首先,修改/home/yinshaohui/apollo5.5/modules/perception/camera/tools/offline/visualizer.cc文件的大概1454行if (all_camera_recieved_ == 0x1) { //0x3这里把all_camera_recieved_ 改成做视觉感知的摄像头数量,我只用了1个front_6mm。参考:https://github.com/ApolloAuto/apollo/blob/master/docs/h

2021-05-20 19:58:00 434 4

原创 ffmpeg resize视频

ffmpeg -i VID_20210225_154452.mp4 -s 480:752 -aspect "30:47" 480_VID_20210225_154452.mp4VID_20210225_154452.mp4 原视频的目录;480_VID_20210225_154452.mp4 新视频的目录;这里我都放在home目录下了480表示resize后新视频的宽,752表示高;-aspect "30:47" 表示新视频的宽高比;...

2021-03-12 14:43:26 677

原创 Python 找出数组中第二大的数

def find_second_largest(arr): """ :param arr: an array consists of numbers :return: the second largest number """ if arr[0] > arr[1]: max_l = arr[0] # the largest number max_sl = arr[1] # the second largest number.

2021-03-06 20:27:30 666

原创 YOLO v5 mosaic数据增强能加快收敛速度

把hyp.scratch.yaml文件中的mosaic:设置为1.0,表示对全部数据做mosaic数据增强;把mosaic设置成0.0表示不做mosaic数据增强。mosaic: 1.0时,跑了10个epoch就能达到50%的准确率,而mosaic: 0.0时,跑50个epoch才能达到50%的准确率。我感觉原因是mosaic数据增强时,把多个图片混合在一起,这样每张图片相对于原数据集中的图片有更多特征,每个epoch网络能学到很多特征,所以收敛速度更快。若是以后遇到每张图片只有1~2个特征时,

2021-02-21 16:27:09 5013 4

原创 YOLO v3损失函数

def loss_layer(self, conv, pred, label, bboxes, anchors, stride): conv_shape = tf.shape(conv) batch_size = conv_shape[0] output_size = conv_shape[1] input_size = stride * output_size conv = tf.reshape(conv, ...

2021-02-14 12:55:41 260

原创 faster rcnn与YOLO v3区别(一段式和二段式)

faster rcnn是通过RPN层提取ROIs,然后把ROIs从feature map上crop下来,再resize到固定大小(7*7)输入全连接层做分类。并在RPN层把前景和背景比例做成1:3,总共大概100~300个ROIs。YOLO v3是图片经过骨干网络后,feature map上面每个点的不同通道表示bounding box的中心和宽高、前景置信度、类别。feature map上每个点有三个bounding box框。由于有大量的背景参与置信度计算loss,前景比较少,不像faster rc

2021-02-14 11:14:30 3381 1

原创 YOLO v3 从decode函数看v3如何预测图片中物体的位置

首先,通过darknet53骨干网络得到大中小三种比例的特征图,图片来自https://zhuanlan.zhihu.com/p/50595699self.conv_lbbox, self.conv_mbbox, self.conv_sbbox = self.__build_nework(input_data)以小anchor为例,即下采样3次,feature map大小变为原来的1/8,FPN部分参考https://blog.csdn.net/ysh1026/article/detail..

2021-02-13 12:23:34 721 1

原创 FPN中不同层的相加or拼接方式

ssg

2021-02-10 11:15:27 731

原创 不要使用pip在conda环境下安装tensorflow

不要使用pip在conda环境下安装tensorflow,原因是pip安装在conda外面,不同虚拟环境下都会是这个pip安装的环境。举个例子,在tensorflow2.2环境下用pip安装tensorflow2.2,那么tensorflow1.15环境下也会变成tensorflow2.2。不同环境下能共用的包可以用pip安装,比如numpy,tensorflow plot等等。...

2021-01-31 11:04:08 397

原创 递归算法之汉诺塔

把n个盘子从A移动到C,相当于把n-1个盘子从A移动到B,再把A最底下的那个盘子移动到C,最后再把n-1个盘子从B移动到C,n-1个盘子继续用递归移动。def hanoi(n, a, b, c): if n == 1: print(a, '-->', c) else: hanoi(n - 1, a, c, b) print(a, '-->', c) hanoi(n - 1, b, a, c)# 调用hanoi

2020-12-20 19:01:45 128

原创 句子中的单词反转

import numpy as npstr = 'This is a cat'length = len(str)reset = ''s = lengtharr = np.arange(length)for i in arr[::-1]: if str[i] == ' ': reset = reset + str[i:s] s = ireset = reset + ' ' + str[:s]print(reset)输出:cat a .

2020-12-17 18:19:29 133 1

原创 算法——找出数组中出现次数最多的数

今天面试中有一道算法题,好长时间没做算法了,虽然很简单,但是当时没做出来,记录一下import numpy as npa = np.array([1,4,5,6,4,7,5,4])#找出数组中出现次数最多的数def find_a(arr): arr_sort = np.sort(arr) ll = np.size(arr) s = np.ones(ll) for i in np.arange(ll-1): if arr_sort[i+1] =.

2020-12-02 21:59:11 3223

原创 机器学习和深度学习中,L2正则化为什么能防止过拟合?

正则化是为了降低模型的复杂度,模型过于复杂,则过拟合;与傅里叶变换类似,高频的部分表示细节,尽量减少高频部分的影响;傅里叶级数也是,高阶表示细节;当阶数较高时,在不降低拟合结果的前提下,降低高阶项的系数;高阶部分的系数会很小,但不一定是0,所以用0-范数不合适,用1-范数或2-范数。参考:https://www.zhihu.com/question/389848505/answer/1179908586...

2020-11-28 12:01:24 1157

原创 faster rcnn 图像识别三大步骤

三大步骤分别是识别、分割、分类。识别:识别是为了得到rois(region of interests,即感兴趣的区域)。首先在卷基层提取特征,再在每个特征上生成anchor[1],把anchor在_region_proposal [2]做识别,提取部分anchor得到rois。分割:上一步中的anchor是相对于原图的,rois自然也是相对于原图的,通过放缩[3],得到rois相对于特征图的位置,并把特征图上对应的特征截取出来[3]。分类:得到rois的特征之后,把特征输入全连接层做分类。.

2020-11-28 08:21:56 914

原创 faster rcnn 损失函数

损失函数分为框预测回归和分类loss,每个都分为rpn和rcnn。rpn损失:_anchor_target_layer 给图像内部的anchors分配rpn_labels(1或0,前景或背景),再和rpn_cls_score做交叉熵,此时只关注物体是前景/背景,不管物体的类别rpn_cross_entropy = tf.reduce_mean( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=rpn_cls_score

2020-11-25 23:29:54 1475

原创 faster rcnn _crop_pool_layer理解

# region of interest pooling if cfg.POOLING_MODE == 'crop': pool5 = self._crop_pool_layer(net_conv, rois, "pool5") def _crop_pool_layer(self, bottom, rois, name): with tf.variable_scope(name) as scope: batch_ids = tf.squeeze(tf.

2020-11-23 15:31:20 295

原创 非线性激活函数的理解

根据万能逼近定理(Universal Approximation Theory),神经网络能以任意精度逼近连续函数。训练神经网络时,先随机初始化卷积核参数,把卷积层的结果输入激活函数层,达到某个阈值则激活该神经元,否则设置为0(ReLU),之后进入池化层。把池化层的输出与真值相减,得到损失函数loss,沿着loss的负梯度方向反向传播,更新卷积核参数。...

2020-11-19 22:28:49 580

原创 faster rcnn 中的 region proposal函数(proposal_layer、anchor_target_layer、proposal_target_layer)

首先,用初始化卷积核(9*2和9*4个)对vgg16生成的feature map(512通道)做卷积,得到没有实际意义[1]的rpn_cls_score和rpn_bbox_pred,之后再根据相应的loss反向传播,更新卷积核。rpn_cls_score是判断框是前景/背景,rpn_bbox_pred是预测bounding box和ground truth之间的偏移量delta。利用softmax函数把rpn_cls_score归一化,得到框属于前景/背景的概率,使前景/背景的概率总和等于1。feature

2020-11-16 22:58:38 360

原创 faster rcnn 在feature map上面生成anchor过程

首先,以左上角的[0,0,15,15]为基准框,在保证面积不变的前提下,把框的宽和高分别做成0.5:1,1:1,1:2三种模式,得到三个anchor(是一个3*4矩阵);第二步,把上一步得到的三个anchor分别放缩8倍、16倍、32倍。原图在vgg16网络中经过4个池化层,所以feature map 的大小是原图的1/16。通过以上两步得到左上角那个feature的9个anchor。由于anchor是在原图上面画框,所以接下来,用meshgrid方法构造出feature map的点在原图上的相

2020-11-15 09:38:59 533

原创 np.where()[0] 和 np.where()[1]

import numpy as npa = np.arange(12).reshape(3,4)print('a:', a)print('np.where(a > 5):', np.where(a > 5))print('a[np.where(a > 5)]:', a[np.where(a > 5)])print('np.where(a > 5)[0]:', np.where(a > 5)[0])print('np.where(a > 5)[1]:'.

2020-11-08 15:26:50 1974

原创 faster rcnn debug路径错误

代码地址https://github.com/endernewton/tf-faster-rcnn在Terminal输入GPU_ID=0 CUDA_VISIBLE_DEVICES=${GPU_ID} ./tools/demo.py 可以跑demo.py。在屏幕上右键debug,报下面的错误le "/home/shaohui/tf-faster-rcnn/tools/demo.py", line 126, in <module> 'our server and plac.

2020-10-14 22:49:07 197

转载 Pytorch dropout输出值变了

https://www.cnblogs.com/marsggbo/p/10592643.html 为保持dropout前后期望值相同,dropout输出值需要除以keep_prob

2020-09-20 08:52:35 1062

原创 java编程寻找目录 C:/Windows 下的最大文件、最小文件

public static void listFiles(File file ){ if(file.isFile()){ if(file.length()>maxSize){ maxSize = file.length(); maxFile = file; } if(file.length()<minSize && file.length()>0){ minSize = file.length(); minFile = file; } }

2017-06-11 19:24:31 1136

C._Thomas_Wu_An_Introduction_to_Object-Oriented_BookFi.org.pdf

C._Thomas_Wu_An_Introduction_to_Object-Oriented_BookFi.org.pdf .有很丰富的练习题

2017-03-16

Java in a Nutshell, 6th Edition.

四百多页,超清,带目录。京东上卖五百多。

2017-03-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除