MCPcopy Create free account
hub / github.com/HYUNJS/SGT / get_transform

Method get_transform

projects/Datasets/Transforms/augmentation.py:206–213  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

204 self._init(locals())
205
206 def get_transform(self, img):
207 do = self._rand_range() < self.prob
208 if do:
209 height, width = img.shape[:2]
210 M, a, s = self.get_warp_matrix(height, width)
211 return FairAffineTransform(width, height, self.border_value, M, a)
212 else:
213 return NoOpTransform()
214
215 def get_warp_matrix(self, height, width):
216 border = 0 # width of added border (optional)

Callers

nothing calls this directly

Calls 2

get_warp_matrixMethod · 0.95
FairAffineTransformClass · 0.90

Tested by

no test coverage detected