Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Verify result image in example by hash
Browse files Browse the repository at this point in the history
Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com>
  • Loading branch information
Acharya committed Mar 13, 2018
1 parent 612e2a6 commit a9b2f62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/python-pytest/onnx/onnx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -121,12 +122,14 @@ def test_super_resolution_example():
'param_1', 'param_0', 'param_3', 'param_2']):
assert param_item in param_keys

logging.getLogger().info("Asserted the result of the onnx model conversion")
logging.info("Asserted the result of the onnx model conversion")

output_img_dim = 672
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__':
Expand Down

0 comments on commit a9b2f62

Please sign in to comment.