MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / blend

Function blend

slowfast/datasets/transform.py:312–325  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

310
311
312def 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
328def grayscale(images):

Callers 3

brightness_jitterFunction · 0.70
contrast_jitterFunction · 0.70
saturation_jitterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected