Apply wavelet decomposition to the input tensor. This function only returns the low frequency & the high frequency.
(image: Tensor, levels=5)
| 92 | return output |
| 93 | |
| 94 | def wavelet_decomposition(image: Tensor, levels=5): |
| 95 | """ |
| 96 | Apply wavelet decomposition to the input tensor. |
| 97 | This function only returns the low frequency & the high frequency. |
| 98 | """ |
| 99 | high_freq = torch.zeros_like(image) |
| 100 | for i in range(levels): |
| 101 | radius = 2 ** i |
| 102 | low_freq = wavelet_blur(image, radius) |
| 103 | high_freq += (image - low_freq) |
| 104 | image = low_freq |
| 105 | |
| 106 | return high_freq, low_freq |
| 107 | |
| 108 | def wavelet_reconstruction(content_feat:Tensor, style_feat:Tensor): |
| 109 | """ |
no test coverage detected