MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / tta_model

Function tta_model

utils/utils.py:284–298  ·  view source on GitHub ↗
(model, image)

Source from the content-addressed store, hash-verified

282 return image
283
284def tta_model(model, image):
285 n_image = image
286 h_image = horizontal_flip(image)
287 v_image = vertical_flip(image)
288
289 n_mask = model.predict(np.expand_dims(n_image, axis=0))[0]
290 h_mask = model.predict(np.expand_dims(h_image, axis=0))[0]
291 v_mask = model.predict(np.expand_dims(v_image, axis=0))[0]
292
293 n_mask = n_mask
294 h_mask = horizontal_flip(h_mask)
295 v_mask = vertical_flip(v_mask)
296
297 mean_mask = (n_mask + h_mask + v_mask) / 3.0
298 return mean_mask
299
300def cal_params_flops(model, size, logger):
301 input = torch.randn(1, 3, size, size).cuda()

Callers

nothing calls this directly

Calls 2

horizontal_flipFunction · 0.85
vertical_flipFunction · 0.85

Tested by

no test coverage detected