Blend two images with a given weight alpha. Args: images1 (tensor): the first images to be blended, the dimension is `num frames` x `channel` x `height` x `width`. images2 (tensor): the second images to be blended, the dimension is `num frames` x `cha
(images1, images2, alpha)
| 310 | |
| 311 | |
| 312 | def blend(images1, images2, alpha): |
| 313 | """ |
| 314 | Blend two images with a given weight alpha. |
| 315 | Args: |
| 316 | images1 (tensor): the first images to be blended, the dimension is |
| 317 | `num frames` x `channel` x `height` x `width`. |
| 318 | images2 (tensor): the second images to be blended, the dimension is |
| 319 | `num frames` x `channel` x `height` x `width`. |
| 320 | alpha (float): the blending weight. |
| 321 | Returns: |
| 322 | (tensor): blended images, the dimension is |
| 323 | `num frames` x `channel` x `height` x `width`. |
| 324 | """ |
| 325 | return images1 * alpha + images2 * (1 - alpha) |
| 326 | |
| 327 | |
| 328 | def grayscale(images): |
no outgoing calls
no test coverage detected