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

Function video_loss

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

Source from the content-addressed store, hash-verified

545 return target, t_2, t_98
546
547def video_loss(prediction, target, mask, Bs):
548 # median norm
549 prediction_nm, a_norm, b_norm = normalize_video_robust(prediction, mask, Bs)
550 target_nm, a_norm_gt, b_norm_gt = normalize_video_robust(target.float(), mask, Bs)
551 depth_loss = nn.functional.l1_loss(prediction_nm[mask], target_nm[mask])
552 # rel depth 2 metric --> (pred - a')/(b'-a')*(b-a) + a
553 scale = (b_norm_gt - a_norm_gt) / (b_norm - a_norm)
554 shift = a_norm_gt - a_norm*scale
555 return depth_loss, scale, shift, prediction_nm, target_nm
556
557def median_loss(prediction, target, mask, Bs):
558 # median norm

Callers

nothing calls this directly

Calls 1

normalize_video_robustFunction · 0.85

Tested by

no test coverage detected