tabayashi0117 / Score-CAM

MIT License
56 stars 19 forks source link

Error, not uniform img size #24

Open ankhafizov opened 2 years ago

ankhafizov commented 2 years ago

https://github.com/tabayashi0117/Score-CAM/blob/313e190000025eee3714a6df77d5c57f98e02299/gradcamutils.py#L85

cv.resize does not work as expected in this line. Please, rewrite this line as:

act_map_resized_list = [np.transpose(cv2.resize(act_map_array[0,:,:,k], input_shape[:2], interpolation=cv2.INTER_LINEAR)) for k in range(act_map_array.shape[3])]

otherwise error appears for rectangle image shape in line: below

https://github.com/tabayashi0117/Score-CAM/blob/313e190000025eee3714a6df77d5c57f98e02299/gradcamutils.py#L99