MCPcopy Create free account
hub / github.com/UCSC-VLAA/OpenVision / posterize

Function posterize

src/transforms/autoaugment.py:233–236  ·  view source on GitHub ↗

Equivalent of PIL Posterize.

(image, bits)

Source from the content-addressed store, hash-verified

231
232
233def posterize(image, bits):
234 """Equivalent of PIL Posterize."""
235 shift = 8 - bits
236 return tf.bitwise.left_shift(tf.bitwise.right_shift(image, shift), shift)
237
238
239def rotate(image, degrees, replace):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected