PV-RCNN代码测试——TP,FP,TN,FN的计算(二)

PV-RCNN:papercode
配套理论篇:PV-RCNN代码解读——TP,FP,TN,FN的计算

compute_statistics_jit函数中添加如下输出代码:

def compute_statistics_jit(overlaps, gt_datas, dt_datas, ignored_gt, ignored_det, dc_bboxes, metric, min_overlap, thresh=0, compute_fp=False,  compute_aos=False):
    # 在函数末尾添加
    print('gt_box_type:',extra['gt_box_type'])
    print('dt_box_type:',extra['dt_box_type'])
    print('gt_box_matched_idx:',extra['gt_box_matched_idx'])
    print('dt_box_matched_idx:',extra['dt_box_matched_idx'])
    print('tp:', tp,',fp:', fp,',fn:', fn,',similarity:',similarity,',thresholds:',thresholds[:thresh_idx],'\n')

采用的测试集是6号图片

# data/kitti/ImageSets/val.txt
000006

开始测试

python test.py --cfg_file cfgs/kitti_models/pv_rcnn.yaml --batch_size 1 --ckpt ../output/kitti_models/pv_rcnn/mydata_1/ckpt/checkpoint_epoch_10.pth --extra_tag 'mydata_2'

仅输出3d的情况,并且仅输出current_class = 0即类型为car的情况

difficuly类型有0,1,2三种,从易到难

除了从eval_class函数中直接调用compute_statistics_jit函数之外,fused_compute_statistics函数中也调用了compute_statistics_jit函数,也会输出结果

============================ results of _prepare_data start ====================
current_class: 0 , difficulty: 0 

gt_box_type: [-1 -1  1 -1 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  0  1 -1 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1 -1  1 -1 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  0  1 -1 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.99477673]

current_class: 0 , difficulty: 1 

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

gt_box_type: [-1  0  1  0 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 2 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

gt_box_type: [-1  1  1  1 -1 -1]
dt_box_type: [ 1  1  1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0  2 -1 -1]
dt_box_matched_idx: [ 2  1  3 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 3 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673 0.87549245]

gt_box_type: [-1  0  1  0 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 2 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

gt_box_type: [-1  1  1  1 -1 -1]
dt_box_type: [ 1  1  1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0  2 -1 -1]
dt_box_matched_idx: [ 2  1  3 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 3 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673 0.87549245]


current_class: 0 , difficulty: 2 

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

fused_compute_statistics
gt_box_type: [-1  0  1  0 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 2 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

gt_box_type: [-1  1  1  1 -1 -1]
dt_box_type: [ 1  1  1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0  2 -1 -1]
dt_box_matched_idx: [ 2  1  3 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 3 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673 0.87549245]

fused_compute_statistics
gt_box_type: [-1  0  1  0 -1 -1]
dt_box_type: [ 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1 -1  0 -1 -1 -1]
dt_box_matched_idx: [ 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 1 ,fp: 0 ,fn: 2 ,similarity: 0.0 ,thresholds: [0.99477673]

gt_box_type: [-1  1  1  0 -1 -1]
dt_box_type: [ 1  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0 -1 -1 -1]
dt_box_matched_idx: [ 2  1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 2 ,fp: 0 ,fn: 1 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673]

gt_box_type: [-1  1  1  1 -1 -1]
dt_box_type: [ 1  1  1 -1 -1 -1 -1 -1 -1 -1 -1]
gt_box_matched_idx: [-1  1  0  2 -1 -1]
dt_box_matched_idx: [ 2  1  3 -1 -1 -1 -1 -1 -1 -1 -1]
tp: 3 ,fp: 0 ,fn: 0 ,similarity: 0.0 ,thresholds: [0.98844492 0.99477673 0.87549245]
============================ results of compute_statistics_jit end ====================

我的其他PV-RCNN代码测试系列文章,如果对你有帮助的话,请给我点赞哦~
PV-RCNN代码测试——TP,FP,TN,FN的计算(一)
PV-RCNN代码测试——TP,FP,TN,FN的计算(二)
PV-RCNN代码测试——gt_annos & dt_annos
PV-RCNN代码测试——计算iou

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
PV-RCNN(Point-Voxel-Region-based Convolutional Neural Network)是一种用于点云目标检测的神经网络模型,其主要思想是将点云数据转换为体素(Voxel)表示,通过将点云划分为不同的体素,将点云数据转换为体素特征图,然后通过卷积神经网络提取特征,最后使用区域建议网络(Region Proposal Network,RPN)和ROI池化层进行目标检测。 PV-RCNN代码解读主要可以从数据预处理、网络模型构建和训练步骤三个方面进行说明。 首先,在数据预处理阶段,代码会先将原始的点云数据转换为体素表达。将点云数据进行体素化可以提高计算效率,同时也有利于在三维空间中建模目标。其次,代码会对体素进行特征提取,通过卷积神经网络对体素特征图进行卷积和池化操作,从而得到更具有表达能力的特征表示。 其次,在网络模型构建阶段,代码会搭建PV-RCNN的网络结构,包括体素特征提取网络和目标检测网络。体素特征提取网络通常采用多层卷积神经网络,用于提取点云体素的特征表示。目标检测网络则包括RPN和ROI池化层,用于生成目标的候选框,并对候选框进行分类和回归。 最后,在训练步骤中,代码会使用已标注的点云数据进行网络模型的训练。通常采用交叉熵损失函数进行分类损失计算,并使用边界框回归损失函数计算位置预测的误差。通过反向传播和优化算法,更新网络参数,使网络能够更好地适应目标检测的任务。 通过对PV-RCNN代码的解读,我们可以更深入地理解其工作原理和实现方式,从而更好地应用于点云目标检测的研究和实践。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值