@@ -219,7 +219,7 @@ def draw_cam(self, x, label, window_size_h=512, alpha=0.6):
219
219
cam -= np .min (cam )
220
220
cam /= np .max (cam )
221
221
cam *= 255.0
222
- cam = cam .astype (' uint8' )
222
+ cam = cam .astype (np . uint8 )
223
223
cam = cv2 .resize (cam , (img_w , img_h ))
224
224
cam = cam [..., np .newaxis ]
225
225
cam = np .concatenate ([cam , cam , cam ], axis = - 1 )
@@ -228,8 +228,8 @@ def draw_cam(self, x, label, window_size_h=512, alpha=0.6):
228
228
cam_blended = cv2 .addWeighted ((org_image * 255 ).astype (np .uint8 ), alpha , cam_jet , (1 - alpha ), 0 )
229
229
230
230
label_box = np .zeros ((img_h , 20 , 3 ), dtype = np .float32 ) + float (label == idx )
231
- label_box = (label_box * 255.0 ).astype (' uint8' )
232
- org_image = (org_image * 255.0 ).astype (' uint8' )
231
+ label_box = (label_box * 255.0 ).astype (np . uint8 )
232
+ org_image = (org_image * 255.0 ).astype (np . uint8 )
233
233
grid_row = np .concatenate ([label_box , org_image , cam , cam_jet , cam_blended ], axis = 1 )
234
234
image_grid = np .append (image_grid , grid_row , axis = 0 ) if image_grid is not None else grid_row .copy ()
235
235
if window_size_h is not None :
0 commit comments