MCPcopy
hub / github.com/lllyasviel/Omost / numpy2pytorch

Function numpy2pytorch

gradio_app.py:102–105  ·  view source on GitHub ↗
(imgs)

Source from the content-addressed store, hash-verified

100
101@torch.inference_mode()
102def numpy2pytorch(imgs):
103 h = torch.from_numpy(np.stack(imgs, axis=0)).float() / 127.5 - 1.0
104 h = h.movedim(-1, 1)
105 return h
106
107
108def resize_without_crop(image, target_width, target_height):

Callers 1

diffusion_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected