MCPcopy Create free account
hub / github.com/CHENGY12/PLOT / normalize8

Function normalize8

visualization.py:9–15  ·  view source on GitHub ↗
(I)

Source from the content-addressed store, hash-verified

7
8# define normalize8 function
9def normalize8(I):
10 mn = np.min(I)
11 mx = np.max(I)
12 mx -= mn
13 mx = 255 / mx
14 ret = np.round((I - mn) * mx).astype(np.uint32)
15 return ret
16
17inv_normalize = transforms.Normalize(
18 mean=[-0.485/0.229, -0.456/0.224, -0.406/0.255],

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected