MCPcopy Create free account
hub / github.com/Pixel-Talk/EHM-Tracker / tensor2image

Function tensor2image

src/modules/pixie/utils/util.py:432–437  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

430 return new_state_dict
431
432def tensor2image(tensor):
433 image = tensor.detach().cpu().numpy()
434 image = image*255.
435 image = np.maximum(np.minimum(image, 255), 0)
436 image = image.transpose(1,2,0)[:,:,[2,1,0]]
437 return image.astype(np.uint8).copy()
438
439def load_config(cfg_file):
440 import yaml

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected