(prediction, target, mask, Bs)
| 555 | return depth_loss, scale, shift, prediction_nm, target_nm |
| 556 | |
| 557 | def 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 | |
| 566 | def reduction_batch_based(image_loss, M): |
| 567 | # average of all valid pixels of the batch |
nothing calls this directly
no test coverage detected