MCPcopy Create free account
hub / github.com/csxmli2016/MARCONetPlusPlus / tensor2numpy

Function tensor2numpy

models/TextEnhancement.py:48–51  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

46 return num_params / 1e6
47
48def tensor2numpy(tensor):
49 tensor = tensor * 0.5 + 0.5
50 tensor = tensor.squeeze(0).permute(1, 2, 0).flip(2)
51 return np.clip(tensor.float().cpu().numpy(), 0, 1) * 255.0
52
53
54class MARCONetPlus(object):

Callers 1

_process_text_lineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected