(img)
| 31 | |
| 32 | |
| 33 | def build_pyramid(img): |
| 34 | level = int(min(math.log2(img.shape[0]), math.log2(img.shape[1]))) + 1 |
| 35 | level = min(5, level) |
| 36 | imgs = [] |
| 37 | for i in range(level): |
| 38 | imgs.append(img) |
| 39 | if i < level - 1: |
| 40 | img = downsample(img) |
| 41 | return imgs |
| 42 | |
| 43 | |
| 44 | def compute_render_loss_pyramid_L1(img, target_pyramid, weight=1.0): |
no test coverage detected