Skip to content

Commit

Permalink
Rename psnr -> psnr_masked to avoid confusion
Browse files Browse the repository at this point in the history
Summary: Previously, "psnr" was evaluated between the masked g.t. image and the render. To avoid confusion, "psnr" is now renamed to "psnr_masked".

Reviewed By: bottler

Differential Revision: D38707511

fbshipit-source-id: 8ee881ab1a05453d6692dde9782333a47d8c1234
  • Loading branch information
davnov134 authored and facebook-github-bot committed Aug 15, 2022
1 parent b677123 commit d35781f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def eval_batch(
mask=mask_crop,
)

for loss_fg_mask, name_postfix in zip((mask_crop, mask_fg), ("", "_fg")):
for loss_fg_mask, name_postfix in zip((mask_crop, mask_fg), ("_masked", "_fg")):

loss_mask_now = mask_crop * loss_fg_mask

Expand Down Expand Up @@ -345,11 +345,11 @@ def eval_batch(
)

if lpips_model is not None:
for gt_image_type in ("_full_image", ""):
for gt_image_type in ("_full_image", "_masked"):
im1, im2 = [
2.0 * im.clamp(0.0, 1.0) - 1.0 # pyre-ignore[16]
for im in (
image_rgb_masked if gt_image_type == "" else image_rgb,
image_rgb_masked if gt_image_type == "_masked" else image_rgb,
cloned_render["image_render"],
)
]
Expand Down
6 changes: 3 additions & 3 deletions tests/implicitron/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ def _check_metrics(self, frame_data, implicitron_render, eval_result):
)

lower_better = {
"psnr": False,
"psnr_masked": False,
"psnr_fg": False,
"psnr_full_image": False,
"depth_abs_fg": True,
"iou": False,
"rgb_l1": True,
"rgb_l1_masked": True,
"rgb_l1_fg": True,
"lpips": True,
"lpips_masked": True,
"lpips_full_image": True,
}

Expand Down

0 comments on commit d35781f

Please sign in to comment.