MCPcopy Create free account
hub / github.com/TPCD/DCCL / SolarizeAdd

Function SolarizeAdd

data/augmentations/randaugment.py:85–91  ·  view source on GitHub ↗
(img, addition=0, threshold=128)

Source from the content-addressed store, hash-verified

83
84
85def SolarizeAdd(img, addition=0, threshold=128):
86 img_np = np.array(img).astype(np.int)
87 img_np = img_np + addition
88 img_np = np.clip(img_np, 0, 255)
89 img_np = img_np.astype(np.uint8)
90 img = Image.fromarray(img_np)
91 return PIL.ImageOps.solarize(img, threshold)
92
93
94def Posterize(img, v): # [4, 8]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected