Hi,
I run into strange behaviour with pack_img and unpack_img which I can not explain.
Why in the following case, I can not get the original image when I pass it sequentially to pack_img and then to unpack_img? Is it expected?
header = mx.recordio.IRHeader(0, 1, 1, 0)
img = np.ones((5, 5, 3), np.int) * 125
img[0][0][0] = 0.0
packed_s = mx.recordio.pack_img(header, img, quality=100)
img_decoded = mx.recordio.unpack_img(packed_s)
assert(np.array_equal(img, img_decoded[1])). /// it fails
when I change the values of all channel, it works almost:
header = mx.recordio.IRHeader(0, 1, 1, 0)
img = np.ones((5, 5, 3), np.int) * 125
img[0][0][0] = 0.0
img[0][0][1] = 0.0
img[0][0][2] = 0.0
packed_s = mx.recordio.pack_img(header, img, quality=100)
img_decoded = mx.recordio.unpack_img(packed_s)
assert(np.array_equal(img, img_decoded[1])) //it fails
I have small difference (125 vs 124) on 2 pixels (3,3) and (4,4) on the three channels!
Thank you for the help