Skip to content

Commit 000aec2

Browse files
committed
fix bug
1 parent 20eaacd commit 000aec2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

detection/grad_cam_retinanet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __call__(self, inputs, index=0):
5757
:return:
5858
"""
5959
self.net.zero_grad()
60-
output = self.net.inference([inputs])
60+
output = self.net.predict([inputs])
6161
print(output)
6262
score = output[0]['instances'].scores[index]
6363
feature_level = output[0]['instances'].feature_levels[index] # box来自第几层feature map
@@ -97,7 +97,7 @@ def __call__(self, inputs, index=0):
9797
:return:
9898
"""
9999
self.net.zero_grad()
100-
output = self.net.inference([inputs])
100+
output = self.net.predict([inputs])
101101
print(output)
102102
score = output[0]['instances'].scores[index]
103103
feature_level = output[0]['instances'].feature_levels[index] # box来自第几层feature map
@@ -125,6 +125,5 @@ def __call__(self, inputs, index=0):
125125
# 缩放到输入图像尺寸
126126
h, w = inputs['height'], inputs['width']
127127
cam = cv2.resize(cam, (w, h))
128-
box = output[0]['instances'].pred_boxes.tensor[index].detach().numpy().astype(np.int32)
129128

130-
return cam, box
129+
return cam

0 commit comments

Comments
 (0)