MCPcopy Create free account
hub / github.com/AgentMaker/PaddleQuickInference / postprocess

Function postprocess

examples/UGATIT/processor.py:26–41  ·  view source on GitHub ↗
(outputs, output_dir, model_name)

Source from the content-addressed store, hash-verified

24 return img
25
26def postprocess(outputs, output_dir, model_name):
27 # 反归一化
28 img = (outputs[0] * 0.5 + 0.5) * 255.
29
30 # 限幅
31 img = np.clip(img, 0, 255).astype(np.uint8)
32
33 # 转置
34 img = img.transpose((1, 2, 0))
35
36 # 检查输出目录
37 if not os.path.exists(output_dir):
38 os.makedirs(output_dir)
39
40 # 写入输出图片
41 cv2.imwrite(os.path.join(output_dir, '%s.jpg' % model_name), img)

Callers 1

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected