From 680adc70eaa8b8ce5cec24ee4bf250e89ffdedda Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 28 Jan 2023 23:08:56 -0600 Subject: [PATCH] feat(api): save output of each stage in debug mode --- api/onnx_web/chain/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/onnx_web/chain/base.py b/api/onnx_web/chain/base.py index 9e418d7d0..7bfd49a57 100644 --- a/api/onnx_web/chain/base.py +++ b/api/onnx_web/chain/base.py @@ -96,6 +96,9 @@ def stage_tile(tile: Image.Image, _dims) -> Image.Image: logger.info('finished stage %s, result size: %sx%s', name, image.width, image.height) + if is_debug(): + image.save(path.join(ctx.output_path, 'last-stage.png')) + end = monotonic() duration = timedelta(seconds=(end - start)) logger.info('finished pipeline in %s, result size: %sx%s',