MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / __call__

Method __call__

core/utils/flow_transforms.py:52–65  ·  view source on GitHub ↗
(self, inputs, target)

Source from the content-addressed store, hash-verified

50 self.code=cv2.INTER_CUBIC
51
52 def __call__(self, inputs, target):
53 if self.ratio==1:
54 return inputs, target
55 h, w, _ = inputs[0].shape
56 ratio = self.ratio
57
58 inputs[0] = cv2.resize(inputs[0], None, fx=ratio,fy=ratio,interpolation=cv2.INTER_LINEAR)
59 inputs[1] = cv2.resize(inputs[1], None, fx=ratio,fy=ratio,interpolation=cv2.INTER_LINEAR)
60 # keep the mask same
61 tmp = cv2.resize(target[:,:,2], None, fx=ratio,fy=ratio,interpolation=cv2.INTER_NEAREST)
62 target = cv2.resize(target, None, fx=ratio,fy=ratio,interpolation=self.code) * ratio
63 target[:,:,2] = tmp
64
65 return inputs, target
66
67
68

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected