MCPcopy Create free account
hub / github.com/CompVis/zigma / ToTensorVideo

Class ToTensorVideo

datasets/video_utils.py:403–422  ·  view source on GitHub ↗

Convert tensor data type from uint8 to float, divide value by 255.0 and permute the dimensions of clip tensor

Source from the content-addressed store, hash-verified

401
402
403class ToTensorVideo:
404 """
405 Convert tensor data type from uint8 to float, divide value by 255.0 and
406 permute the dimensions of clip tensor
407 """
408
409 def __init__(self):
410 pass
411
412 def __call__(self, clip):
413 """
414 Args:
415 clip (torch.tensor, dtype=torch.uint8): Size is (T, C, H, W)
416 Return:
417 clip (torch.tensor, dtype=torch.float): Size is (T, C, H, W)
418 """
419 return to_tensor(clip)
420
421 def __repr__(self) -> str:
422 return self.__class__.__name__
423
424
425class RandomHorizontalFlipVideo:

Callers 1

get_transforms_videoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected