mhamilton723/STEGO

Provide explanation for the demo?

Opened this issue · 1 comments

with torch.no_grad():
code1 = model(img)
code2 = model(img.flip(dims=[3]))
code = (code1 + code2.flip(dims=[3])) / 2
code = F.interpolate(code, img.shape[-2:], mode='bilinear', align_corners=False)
linear_probs = torch.log_softmax(model.linear_probe(code), dim=1).cpu()
cluster_probs = model.cluster_probe(code, 2, log_probs=True).cpu()

single_img = img[0].cpu()
linear_pred = dense_crf(single_img, linear_probs[0]).argmax(0)
cluster_pred = dense_crf(single_img, cluster_probs[0]).argmax(0)

Hi, I am not sure why you do the first three lines for the input picture? Could you please provide some comments? Thanks a lot!

with torch.no_grad(): code1 = model(img) code2 = model(img.flip(dims=[3])) code = (code1 + code2.flip(dims=[3])) / 2 code = F.interpolate(code, img.shape[-2:], mode='bilinear', align_corners=False) linear_probs = torch.log_softmax(model.linear_probe(code), dim=1).cpu() cluster_probs = model.cluster_probe(code, 2, log_probs=True).cpu()

single_img = img[0].cpu() linear_pred = dense_crf(single_img, linear_probs[0]).argmax(0) cluster_pred = dense_crf(single_img, cluster_probs[0]).argmax(0)

Hi, I am not sure why you do the first three lines for the input picture? Could you please provide some comments? Thanks a lot!

Hey did you find a solution?

EDIT: I think he kinda gave an explanation in #22.