Skip to content

Commit

Permalink
Update lpips.py
Browse files Browse the repository at this point in the history
  • Loading branch information
richzhang authored Sep 14, 2020
1 parent a1188a3 commit 0196579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lpips/lpips.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def __init__(self, pretrained=True, net='alex', version='0.1', lpips=True, spati

def forward(self, in0, in1, retPerLayer=False, normalize=False):
if normalize: # turn on this flag if input is [0,1] so it can be adjusted to [-1, +1]
target = 2 * target - 1
pred = 2 * pred - 1
in0 = 2 * in0 - 1
in1 = 2 * in1 - 1

# v0.0 - original release had a bug, where input was not scaled
in0_input, in1_input = (self.scaling_layer(in0), self.scaling_layer(in1)) if self.version=='0.1' else (in0, in1)
Expand Down

0 comments on commit 0196579

Please sign in to comment.