(self, inputs, target)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected