def class_activation_map(feature_conv: np.ndarray, weight_softmax: np.ndarray, class_idx: List[int]):
    size_upsample = (256, 256)
    (nc, h, w) = feature_conv.shape
    output_cam = []
    for _ in class_idx:
        cam = weight_softmax[class_idx].dot(feature_conv.reshape((nc, (h * w))))
        cam = cam.reshape(h, w)
        cam = (cam - np.min(cam))
        cam_img = (cam / np.max(cam))
        cam_img = np.uint8((255 * cam_img))
        output_cam.append(cv2.resize(cam_img, size_upsample))
    return output_cam
def class_activation_map(feature_conv: np.ndarray, weight_softmax: np.ndarray, class_idx: List[int]):
    size_upsample = (256, 256)
    (nc, h, w) = feature_conv.shape
    output_cam = []
    for _ in class_idx:
        cam = weight_softmax[class_idx].dot(feature_conv.reshape((nc, (h * w))))
        cam = cam.reshape(h, w)
        cam = (cam - np.min(cam))
        cam_img = (cam / np.max(cam))
        cam_img = np.uint8((255 * cam_img))
        output_cam.append(cv2.resize(cam_img, size_upsample))
    return output_cam