MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / randomRotation

Function randomRotation

utils/data_val.py:55–62  ·  view source on GitHub ↗
(image, label, edge)

Source from the content-addressed store, hash-verified

53 return image.crop(random_region), label.crop(random_region)
54
55def randomRotation(image, label, edge):
56 mode = Image.BICUBIC
57 if random.random() > 0.8:
58 random_angle = np.random.randint(-15, 15)
59 image = image.rotate(random_angle, mode)
60 label = label.rotate(random_angle, mode)
61 edge = edge.rotate(random_angle, mode)
62 return image, label, edge
63
64def randomRotation_noEdge(image, label):
65 mode = Image.BICUBIC

Callers 3

__getitem__Method · 0.85
__getitem__Method · 0.85
__getitem__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected