MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / __call__

Method __call__

dmidas/transforms.py:218–234  ·  view source on GitHub ↗
(self, sample)

Source from the content-addressed store, hash-verified

216 pass
217
218 def __call__(self, sample):
219 image = np.transpose(sample["image"], (2, 0, 1))
220 sample["image"] = np.ascontiguousarray(image).astype(np.float32)
221
222 if "mask" in sample:
223 sample["mask"] = sample["mask"].astype(np.float32)
224 sample["mask"] = np.ascontiguousarray(sample["mask"])
225
226 if "disparity" in sample:
227 disparity = sample["disparity"].astype(np.float32)
228 sample["disparity"] = np.ascontiguousarray(disparity)
229
230 if "depth" in sample:
231 depth = sample["depth"].astype(np.float32)
232 sample["depth"] = np.ascontiguousarray(depth)
233
234 return sample

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected