This commit introduces image importer to convert
jpeg or png images to bin.
The binary file only has the pixel values.
It does not have size.
The output will be used for `tflite_run`.
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
--- /dev/null
+#!/usr/bin/python
+from PIL import Image
+import sys
+import struct
+
+if( len(sys.argv) < 3 ):
+ print("Usage: %s <input image file> <output bin file>"%(sys.argv[0]));
+ exit(0)
+
+img = Image.open(sys.argv[1])
+outfile = sys.argv[2]
+
+print "Image format = ", img.bits, img.size, img.format
+
+with open(outfile, 'wb') as f:
+ f.write(img.tobytes())
+
+print "Done."