Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training coco part code is missing. #1

Open
TyroneLi opened this issue Oct 17, 2021 · 3 comments
Open

Training coco part code is missing. #1

TyroneLi opened this issue Oct 17, 2021 · 3 comments

Comments

@TyroneLi
Copy link

In folder step, train_cam_coco.py is missing. Can you upload it? Thans

@TyroneLi
Copy link
Author

By the way, your code for refining the initial cam see using CRF is not yet released.

@TyroneLi
Copy link
Author

Hello~,anybody~

@jbeomlee93
Copy link
Owner

Sorry for the late reply.

  1. I have updated "step/train_cam_coco.py", but it has not been newly tested.

You can run RIB process with pre-trained classifier provided by https://drive.google.com/file/d/1SDKjPzzuXR4PX_H1l3Kw5NY8d20FmG4X/view.

  1. You can refine the initial cam using CRF similar to below.

cam_dict = np.load(os.path.join(args.cam_out_dir, img_name + '.npy'), allow_pickle=True).item()
cams = cam_dict['high_res']
keys = np.pad(cam_dict['keys'] + 1, (1, 0), mode='constant')
# 1. find confident fg & bg
fg_conf_cam = np.pad(cams, ((1, 0), (0, 0), (0, 0)), mode='constant', constant_values=args.conf_fg_thres)
fg_conf_cam = np.argmax(fg_conf_cam, axis=0)
pred = imutils.crf_inference_label(img, fg_conf_cam, n_labels=keys.shape[0])
fg_conf = keys[pred]
bg_conf_cam = np.pad(cams, ((1, 0), (0, 0), (0, 0)), mode='constant', constant_values=args.conf_bg_thres)
bg_conf_cam = np.argmax(bg_conf_cam, axis=0)
pred = imutils.crf_inference_label(img, bg_conf_cam, n_labels=keys.shape[0])
bg_conf = keys[pred]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants