|
21 | 21 |
|
22 | 22 | S = 7 |
23 | 23 | B = 2 |
24 | | -C = 3 |
| 24 | +# C = 3 |
| 25 | +# cate_list = ['cucumber', 'eggplant', 'mushroom'] |
25 | 26 |
|
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'] |
27 | 30 |
|
28 | 31 | dst_root_dir = './data/outputs' |
29 | 32 | 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, |
127 | 130 | model = file.load_model(device, S, B, C) |
128 | 131 |
|
129 | 132 | 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') |
131 | 135 | # print(img_path_list) |
132 | 136 |
|
133 | 137 | N = len(img_path_list) |
@@ -162,7 +166,7 @@ def save_data(img_name, img, target_cates, target_bboxs, pred_cates, pred_probs, |
162 | 166 | pred_cate_bboxs[:, 3] = pred_bboxs[range(S * S), pred_confidences_idxs * 4 + 3] |
163 | 167 |
|
164 | 168 | # 预测边界框的缩放,回到原始图像 |
165 | | - pred_bboxs = util.deform_bboxs(pred_cate_bboxs, data_dict) |
| 169 | + pred_bboxs = util.deform_bboxs(pred_cate_bboxs, data_dict, S) |
166 | 170 |
|
167 | 171 | # 保存图像/标注边界框/预测边界框 |
168 | 172 | img_name = os.path.splitext(os.path.basename(img_path))[0] |
|
0 commit comments