Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rauch committed Mar 8, 2021
1 parent aaeb31d commit a316a47
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, args):
self.context_dim = cdim = 64
args.corr_levels = 4
args.corr_radius = 3

else:
self.hidden_dim = hdim = 128
self.context_dim = cdim = 128
Expand All @@ -46,12 +46,12 @@ def __init__(self, args):

# feature network, context network, and update block
if args.small:
self.fnet = SmallEncoder(output_dim=128, norm_fn='instance', dropout=args.dropout)
self.fnet = SmallEncoder(output_dim=128, norm_fn='instance', dropout=args.dropout)
self.cnet = SmallEncoder(output_dim=hdim+cdim, norm_fn='none', dropout=args.dropout)
self.update_block = SmallUpdateBlock(self.args, hidden_dim=hdim)

else:
self.fnet = BasicEncoder(output_dim=256, norm_fn='instance', dropout=args.dropout)
self.fnet = BasicEncoder(output_dim=256, norm_fn='instance', dropout=args.dropout)
self.cnet = BasicEncoder(output_dim=hdim+cdim, norm_fn='batch', dropout=args.dropout)
self.update_block = BasicUpdateBlock(self.args, hidden_dim=hdim)

Expand Down Expand Up @@ -97,8 +97,8 @@ def forward(self, image1, image2, iters=torch.tensor(12), flow_init=torch.tensor

# run the feature network
with autocast(enabled=self.args.mixed_precision):
fmap1, fmap2 = self.fnet([image1, image2])
fmap1, fmap2 = self.fnet([image1, image2])

fmap1 = fmap1.float()
fmap2 = fmap2.float()
if self.args.alternate_corr:
Expand Down Expand Up @@ -135,10 +135,10 @@ def forward(self, image1, image2, iters=torch.tensor(12), flow_init=torch.tensor
flow_up = upflow8(coords1 - coords0)
else:
flow_up = self.upsample_flow(coords1 - coords0, up_mask)

flow_predictions.append(flow_up)

if test_mode:
return coords1 - coords0, flow_up

return flow_predictions

0 comments on commit a316a47

Please sign in to comment.