MCPcopy Create free account
hub / github.com/NJU-PCALab/STAR / dwt_init

Function dwt_init

utils_data/opensora/utils/wavelet.py:13–26  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

11
12
13def dwt_init(x):
14
15 x01 = x[:,:, :, 0::2, :] / 2
16 x02 = x[:,:, :, 1::2, :] / 2
17 x1 = x01[:,:, :, :, 0::2]
18 x2 = x02[:,:, :, :, 0::2]
19 x3 = x01[:,:, :, :, 1::2]
20 x4 = x02[:,:, :, :, 1::2]
21 x_LL = x1 + x2 + x3 + x4
22 x_HL = -x1 - x2 + x3 + x4
23 x_LH = -x1 + x2 - x3 + x4
24 x_HH = x1 - x2 - x3 + x4
25
26 return torch.cat((x_LL, x_HL, x_LH, x_HH), 1)
27
28
29# 使用哈尔 haar 小波变换来实现二维离散小波

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected