MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / process_output

Method process_output

src/model.py:442–450  ·  view source on GitHub ↗
(output, absolute, smoothing=None, self_filter=False, twice_filter=False)

Source from the content-addressed store, hash-verified

440 return mask
441
442 def process_output(output, absolute, smoothing=None, self_filter=False, twice_filter=False):
443 output = torch.cat(output, dim=0)
444 output = output.sum(0) / output.shape[0]
445 if not absolute:
446 output = (output - output.min()) / (output.max() - output.min() + 1e-8)
447 mask = output[:, :]
448 if smoothing is not None:
449 mask = apply_smoothing_and_filter(mask, smoothing, self_filter, twice_filter)
450 return mask
451
452 def calculate_IoU(mask1, mask2, smooth=1):
453 mask1 = mask1.view(-1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected