MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / __init__

Method __init__

CV/PWCNet/data/datasets.py:32–36  ·  view source on GitHub ↗
(self, image_size, crop_size)

Source from the content-addressed store, hash-verified

30
31class StaticRandomCrop(object):
32 def __init__(self, image_size, crop_size):
33 self.th, self.tw = crop_size
34 h, w = image_size
35 self.h1 = random.randint(0, h - self.th)
36 self.w1 = random.randint(0, w - self.tw)
37
38 def __call__(self, img):
39 return img[self.h1:(self.h1 + self.th), self.w1:(self.w1 + self.tw), :]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected