From 57386f22843bb5760d3997f9659fac1760ec2278 Mon Sep 17 00:00:00 2001 From: Acharya Date: Tue, 13 Mar 2018 10:52:51 -0700 Subject: [PATCH] Verify result image in example by hash Signed-off-by: Acharya --- tests/python-pytest/onnx/onnx_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/python-pytest/onnx/onnx_test.py b/tests/python-pytest/onnx/onnx_test.py index 75f5fe7258bd..34e185286edb 100644 --- a/tests/python-pytest/onnx/onnx_test.py +++ b/tests/python-pytest/onnx/onnx_test.py @@ -26,6 +26,7 @@ import os import unittest import logging +import hashlib import numpy as np import numpy.testing as npt from onnx import helper @@ -127,6 +128,8 @@ def test_super_resolution_example(): input_image, img_cb, img_cr = super_resolution.get_test_image() result_img = super_resolution.perform_inference(sym, params, input_image, img_cb, img_cr) + + assert hashlib.md5(result_img.tobytes()).hexdigest() == '0d98393a49b1d9942106a2ed89d1e854' assert result_img.size == (output_img_dim, output_img_dim) if __name__ == '__main__':