PV-RCNN:paper,code
配套理论篇: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