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

Method __call__

datasets/video_utils.py:259–273  ·  view source on GitHub ↗

Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) Returns: torch.tensor: scale resized / center cropped video clip. size is (T, C, crop_size, crop_size)

(self, clip)

Source from the content-addressed store, hash-verified

257 self.interpolation_mode = interpolation_mode
258
259 def __call__(self, clip):
260 """
261 Args:
262 clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W)
263 Returns:
264 torch.tensor: scale resized / center cropped video clip.
265 size is (T, C, crop_size, crop_size)
266 """
267 clip_center_crop = center_crop_using_short_edge(clip)
268 clip_center_crop_resize = resize(
269 clip_center_crop,
270 target_size=self.size,
271 interpolation_mode=self.interpolation_mode,
272 )
273 return clip_center_crop_resize
274
275 def __repr__(self) -> str:
276 return f"{self.__class__.__name__}(size={self.size}, interpolation_mode={self.interpolation_mode}"

Callers

nothing calls this directly

Calls 2

resizeFunction · 0.85

Tested by

no test coverage detected