未验证 提交 692d7329 编写于 作者: W Wenyu 提交者: GitHub

swin shift window (#4954)

上级 3e0e3585
...@@ -493,8 +493,13 @@ class BasicLayer(nn.Layer): ...@@ -493,8 +493,13 @@ class BasicLayer(nn.Layer):
cnt = 0 cnt = 0
for h in h_slices: for h in h_slices:
for w in w_slices: for w in w_slices:
img_mask[:, h, w, :] = cnt try:
img_mask[:, h, w, :] = cnt
except:
pass
cnt += 1 cnt += 1
mask_windows = window_partition( mask_windows = window_partition(
img_mask, self.window_size) # nW, window_size, window_size, 1 img_mask, self.window_size) # nW, window_size, window_size, 1
mask_windows = mask_windows.reshape( mask_windows = mask_windows.reshape(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册