Skip to content

Commit d7ba21d

Browse files
committed
perf(detect): 更新批量测试VOC 07
1 parent affcbe6 commit d7ba21d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

py/batch_detect.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@
2121

2222
S = 7
2323
B = 2
24-
C = 3
24+
# C = 3
25+
# cate_list = ['cucumber', 'eggplant', 'mushroom']
2526

26-
cate_list = ['cucumber', 'eggplant', 'mushroom']
27+
C = 20
28+
cate_list = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable',
29+
'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor']
2730

2831
dst_root_dir = './data/outputs'
2932
dst_target_dir = os.path.join(dst_root_dir, 'targets')
@@ -127,7 +130,8 @@ def save_data(img_name, img, target_cates, target_bboxs, pred_cates, pred_probs,
127130
model = file.load_model(device, S, B, C)
128131

129132
transform = get_transform()
130-
img_path_list, annotation_path_list = load_data('./data/location_dataset')
133+
# img_path_list, annotation_path_list = load_data('./data/location_dataset')
134+
img_path_list, annotation_path_list = load_data('./data/VOC_dataset')
131135
# print(img_path_list)
132136

133137
N = len(img_path_list)
@@ -162,7 +166,7 @@ def save_data(img_name, img, target_cates, target_bboxs, pred_cates, pred_probs,
162166
pred_cate_bboxs[:, 3] = pred_bboxs[range(S * S), pred_confidences_idxs * 4 + 3]
163167

164168
# 预测边界框的缩放,回到原始图像
165-
pred_bboxs = util.deform_bboxs(pred_cate_bboxs, data_dict)
169+
pred_bboxs = util.deform_bboxs(pred_cate_bboxs, data_dict, S)
166170

167171
# 保存图像/标注边界框/预测边界框
168172
img_name = os.path.splitext(os.path.basename(img_path))[0]

0 commit comments

Comments
 (0)