Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CompVis/diff2flow
/ un_normalize_ims
Function
un_normalize_ims
diff2flow/helpers.py:173–176 ·
view source on GitHub ↗
Convert from [-1, 1] to [0, 255]
(ims)
Source
from the content-addressed store, hash-verified
171
172
173
def
un_normalize_ims(ims):
174
""
" Convert from [-1, 1] to [0, 255] "
""
175
ims = ((ims * 127.5) + 127.5).clip(0, 255).to(torch.uint8)
176
return
ims
Callers
1
__call__
Method · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected