MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / Solarization

Class Solarization

utils.py:57–68  ·  view source on GitHub ↗

Apply Solarization to the PIL image.

Source from the content-addressed store, hash-verified

55
56
57class Solarization(object):
58 """
59 Apply Solarization to the PIL image.
60 """
61 def __init__(self, p):
62 self.p = p
63
64 def __call__(self, img):
65 if random.random() < self.p:
66 return ImageOps.solarize(img)
67 else:
68 return img
69
70
71def load_pretrained_weights(model, pretrained_weights, checkpoint_key, model_name, patch_size):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected