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

Function postprocess

examples/MiDaS/processor.py:43–56  ·  view source on GitHub ↗
(results, output_dir, img_path, model_name)

Source from the content-addressed store, hash-verified

41
42# 数据后处理函数
43def postprocess(results, output_dir, img_path, model_name):
44 # 检查输出目录
45 if not os.path.exists(output_dir):
46 os.mkdir(output_dir)
47
48 # 读取输入图像
49 img = cv2.imread(img_path)
50 h, w = img.shape[:2]
51
52 # 缩放回原尺寸
53 output = cv2.resize(results[0], (w, h), interpolation=cv2.INTER_CUBIC)
54
55 # 可视化输出
56 pfm_f, png_f = write_depth(os.path.join(output_dir, model_name), output, bits=2)

Callers 1

main.pyFile · 0.90

Calls 1

write_depthFunction · 0.90

Tested by

no test coverage detected