Convert tensor data type from uint8 to float, divide value by 255.0 and permute the dimensions of clip tensor
| 401 | |
| 402 | |
| 403 | class 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 | |
| 425 | class RandomHorizontalFlipVideo: |
no outgoing calls
no test coverage detected