MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / median_loss

Function median_loss

preprocess/SpaTrackV2_code/models/utils.py:557–564  ·  view source on GitHub ↗
(prediction, target, mask, Bs)

Source from the content-addressed store, hash-verified

555 return depth_loss, scale, shift, prediction_nm, target_nm
556
557def median_loss(prediction, target, mask, Bs):
558 # median norm
559 prediction_nm, a_norm, b_norm = normalize_prediction_robust(prediction, mask, Bs)
560 target_nm, a_norm_gt, b_norm_gt = normalize_prediction_robust(target.float(), mask, Bs)
561 depth_loss = nn.functional.l1_loss(prediction_nm[mask], target_nm[mask])
562 scale = b_norm_gt/b_norm
563 shift = a_norm_gt - a_norm*scale
564 return depth_loss, scale, shift, prediction_nm, target_nm
565
566def reduction_batch_based(image_loss, M):
567 # average of all valid pixels of the batch

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected