Skip to content

Commit

Permalink
added anchor_self to self_action
Browse files Browse the repository at this point in the history
  • Loading branch information
gauenk committed Nov 21, 2023
1 parent 5a63c0b commit 3176baf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/stnls/nn/non_local_attn_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def forward(self, vid, flows=None, state=None):

# -- search --
dists,inds = self.run_search(q_vid,k_vid,flows,state)
# print(inds.shape)

# -- normalize --
weights,inds = self.run_normalize(dists,inds)
Expand Down
4 changes: 2 additions & 2 deletions lib/stnls/search/impl/non_local_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def forward(vid0, vid1, flows,
reflect_bounds, full_ws, patch_offset, dist_type_i)

# -- anchor --
menu = [None,"anchor","anchor_each","remove",]
menu = [None,"anchor","anchor_self","anchor_each","remove",]
menu += ["remove_ref_frame","anchor_and_remove_ref_frame"]
assert self_action in menu
anchor_self = False if self_action is None else "anchor" in self_action
if self_action == "anchor":
if self_action in ["anchor","anchor_self"]:
stnls.nn.anchor_self(dists,inds,stride0,H,W)
elif self_action == "anchor_each":
stnls.nn.anchor_self_time(dists,inds,flows,wt,stride0,H,W)
Expand Down
2 changes: 1 addition & 1 deletion lib/stnls/search/impl/refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def forward(vid0, vid1, flows,
assert self_action == None

# -- topk --
assert self_action in [None,"anchor","anchor_each"]
assert self_action in [None,"anchor","anchor_self","anchor_each"]
anchor_self = False if self_action is None else "anchor" in self_action
if topk_mode == "all":
dim = 3
Expand Down

0 comments on commit 3176baf

Please sign in to comment.