MedSegDiff
MedSegDiff copied to clipboard
about the code in p_sample_loop_known
if dice_score(final["sample"][:,-1,:,:].unsqueeze(1), final["cal"]) < 0.65: cal_out = torch.clamp(final["cal"] + 0.25 * final["sample"][:,-1,:,:].unsqueeze(1), else: cal_out = torch.clamp(final["cal"] * 0.5 + 0.5 * final["sample"][:,-1,:,:].unsqueeze(1), 0, 1)
What is the main purpose of this code?
same question
same question. What's more important, as show below, why the cal_out can represent the final segmentation result? co = th.tensor(cal_out) print('the shape of sample :', sample.shape, sample[:, -1, :, :].shape) if args.version == 'new': enslist.append(sample[:,-1,:,:]) else: enslist.append(co)