(self, videos)
| 525 | clean='whitespace') |
| 526 | |
| 527 | def visual(self, videos): |
| 528 | # preprocess |
| 529 | size = (self.model.image_size,) * 2 |
| 530 | videos = torch.cat([ |
| 531 | F.interpolate( |
| 532 | u.transpose(0, 1), |
| 533 | size=size, |
| 534 | mode='bicubic', |
| 535 | align_corners=False) for u in videos |
| 536 | ]) |
| 537 | videos = self.transforms.transforms[-1](videos.mul_(0.5).add_(0.5)) |
| 538 | |
| 539 | # forward |
| 540 | with torch.cuda.amp.autocast(dtype=self.dtype): |
| 541 | out = self.model.visual(videos, use_31_block=True) |
| 542 | return out |
no outgoing calls
no test coverage detected