MCPcopy Create free account
hub / github.com/TPCD/LifelongReID / transform_patch

Method transform_patch

lreid/data/transforms.py:198–203  ·  view source on GitHub ↗
(self, patch)

Source from the content-addressed store, hash-verified

196 return None, None
197
198 def transform_patch(self, patch):
199 if random.uniform(0, 1) > self.prob_flip_leftright:
200 patch = patch.transpose(Image.FLIP_LEFT_RIGHT)
201 if random.uniform(0, 1) > self.prob_rotate:
202 patch = patch.rotate(random.randint(-10, 10))
203 return patch
204
205 def __call__(self, img):
206 W, H = img.size # original image size

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected