|
24 | 24 |
|
25 | 25 | class TestExplainMethods: |
26 | 26 | ref_saliency_shapes = { |
27 | | - "MobileNetV2-ATSS": (2, 4, 4), |
28 | | - "ResNeXt101-ATSS": (2, 4, 4), |
| 27 | + "MobileNetV2-ATSS": (2, 13, 13), |
| 28 | + "ResNeXt101-ATSS": (2, 13, 13), |
29 | 29 | "SSD": (81, 13, 13), |
30 | | - "YOLOX-TINY": (80, 13, 13), |
31 | | - "YOLOX-S": (80, 13, 13), |
32 | | - "YOLOX-L": (80, 13, 13), |
33 | | - "YOLOX-X": (80, 13, 13), |
| 30 | + "YOLOX-TINY": (80, 26, 26), |
| 31 | + "YOLOX-S": (80, 26, 26), |
| 32 | + "YOLOX-L": (80, 26, 26), |
| 33 | + "YOLOX-X": (80, 26, 26), |
34 | 34 | } |
35 | 35 |
|
36 | 36 | ref_saliency_vals_det = { |
37 | | - "MobileNetV2-ATSS": np.array([67, 216, 255, 57], dtype=np.uint8), |
38 | | - "ResNeXt101-ATSS": np.array([75, 214, 229, 173], dtype=np.uint8), |
39 | | - "YOLOX-TINY": np.array([80, 28, 42, 53, 49, 68, 72, 75, 69, 57, 65, 6, 157], dtype=np.uint8), |
40 | | - "YOLOX-S": np.array([75, 178, 151, 159, 150, 148, 144, 144, 147, 144, 147, 142, 189], dtype=np.uint8), |
41 | | - "YOLOX-L": np.array([43, 28, 0, 6, 7, 19, 22, 17, 14, 18, 25, 7, 34], dtype=np.uint8), |
42 | | - "YOLOX-X": np.array([255, 144, 83, 76, 83, 86, 82, 90, 91, 93, 110, 104, 83], dtype=np.uint8), |
43 | | - "SSD": np.array([119, 72, 118, 35, 39, 30, 31, 31, 36, 27, 44, 23, 61], dtype=np.uint8), |
| 37 | + "MobileNetV2-ATSS": np.array([34, 67, 148, 132, 172, 147, 146, 155, 167, 159], dtype=np.uint8), |
| 38 | + "ResNeXt101-ATSS": np.array([52, 75, 68, 76, 89, 94, 101, 111, 125, 123], dtype=np.uint8), |
| 39 | + "YOLOX-TINY": np.array([177, 94, 147, 147, 161, 162, 164, 164, 163, 166], dtype=np.uint8), |
| 40 | + "YOLOX-S": np.array([158, 170, 180, 158, 152, 148, 153, 153, 148, 145], dtype=np.uint8), |
| 41 | + "YOLOX-L": np.array([255, 80, 97, 88, 73, 71, 72, 76, 75, 76], dtype=np.uint8), |
| 42 | + "YOLOX-X": np.array([185, 218, 189, 103, 83, 70, 62, 66, 66, 67], dtype=np.uint8), |
| 43 | + "SSD": np.array([255, 178, 212, 90, 93, 79, 79, 80, 87, 83], dtype=np.uint8), |
44 | 44 | } |
45 | 45 |
|
46 | 46 | ref_saliency_vals_det_wo_postprocess = { |
47 | | - "MobileNetV2-ATSS": -0.10465062, |
48 | | - "ResNeXt101-ATSS": -0.073549636, |
| 47 | + "MobileNetV2-ATSS": -0.014513552, |
| 48 | + "ResNeXt101-ATSS": -0.055565584, |
49 | 49 | "YOLOX-TINY": 0.04948914, |
50 | | - "YOLOX-S": 0.01133332, |
51 | | - "YOLOX-L": 0.01870133, |
| 50 | + "YOLOX-S": 0.011557617, |
| 51 | + "YOLOX-L": 0.020231, |
52 | 52 | "YOLOX-X": 0.0043506604, |
53 | 53 | "SSD": 0.6629989, |
54 | 54 | } |
@@ -93,7 +93,7 @@ def test_saliency_map_det(self, template): |
93 | 93 | assert saliency_maps[0].ndim == 3 |
94 | 94 | assert saliency_maps[0].shape == self.ref_saliency_shapes[template.name] |
95 | 95 | # convert to int16 in case of negative value difference |
96 | | - actual_sal_vals = saliency_maps[0][0][0].astype(np.int16) |
| 96 | + actual_sal_vals = saliency_maps[0][0][0][:10].astype(np.int16) |
97 | 97 | ref_sal_vals = self.ref_saliency_vals_det[template.name].astype(np.uint8) |
98 | 98 | assert np.all(np.abs(actual_sal_vals - ref_sal_vals) <= 1) |
99 | 99 |
|
|
0 commit comments