# Path: utils/imgproc.py
# def imread_rgb(dset, path):
# def imread_oflow(dset, *paths):
# def imread_depth(dset, path):
# def inpaint(img, threshold=1):
# def resize(video, size, interpolation):
# def proc_oflow(images):


import collections
import math
import numbers
import random
import numpy as np
import torch
import torch.nn.functional as F
import utils
from utils import imgproc
                                     len(size) == 2)
    self.size = size
    self.transform_pixel = transform_pixel
    self.interpolation = interpolation

  def __call__(self, video):
    """Args: video (numpy.ndarray): Video to be scaled.

    Returns:
        numpy.ndarray: Rescaled video.
    """
    w, h = video.shape[-2], video.shape[-3]

    if isinstance(self.size, int):
      if (w <= h and w == self.size) or (h <= w and h == self.size):
        return video

      if w < h:
        ow = self.size
        oh = int(self.size * h / w)
        video = imgproc.resize(video, (oh, ow), self.interpolation)
      else:
        oh = self.size
        ow = int(self.size * w / h)
        video = imgproc.resize(video, (oh, ow), self.interpolation)

      if self.transform_pixel:
        video[..., 0] = (video[..., 0] - 128) * (ow / w) + 128
        video[..., 1] = (video[..., 1] - 128) * (oh / h) + 128
    else:

# Path: utils/imgproc.py
# def imread_rgb(dset, path):
# def imread_oflow(dset, *paths):
# def imread_depth(dset, path):
# def inpaint(img, threshold=1):
# def resize(video, size, interpolation):
# def proc_oflow(images):


# Path: third_party/two_stream_pytorch/video_transforms.py
import collections
import math
import numbers
import random
import numpy as np
import torch
import torch.nn.functional as F
import utils
from utils import imgproc

                                     len(size) == 2)
    self.size = size
    self.transform_pixel = transform_pixel
    self.interpolation = interpolation

  def __call__(self, video):
    """Args: video (numpy.ndarray): Video to be scaled.

    Returns:
        numpy.ndarray: Rescaled video.
    """
    w, h = video.shape[-2], video.shape[-3]

    if isinstance(self.size, int):
      if (w <= h and w == self.size) or (h <= w and h == self.size):
        return video

      if w < h:
        ow = self.size
        oh = int(self.size * h / w)
        video = imgproc.resize(video, (oh, ow), self.interpolation)
      else:
        oh = self.size
        ow = int(self.size * w / h)
        video = imgproc.resize(video, (oh, ow), self.interpolation)

      if self.transform_pixel:
        video[..., 0] = (video[..., 0] - 128) * (ow / w) + 128
        video[..., 1] = (video[..., 1] - 128) * (oh / h) + 128
    else:

      video = imgproc.resize(video, self.size, self.interpolation)