diff options
author | Daniil Kazantsev <dkazanc@hotmail.com> | 2019-06-02 14:07:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-02 14:07:14 +0100 |
commit | 57229985e3576db6a714d7e4a35aec4f47120e1b (patch) | |
tree | 8716aa2a793e525692e2516133d438e97c124f4f /demos | |
parent | 5fb5be32360bab1b6619bcef192dde0878d014ff (diff) | |
parent | a532c5efb8f20a8eb400fdad0edc00dad50a5c46 (diff) | |
download | regularization-57229985e3576db6a714d7e4a35aec4f47120e1b.tar.gz regularization-57229985e3576db6a714d7e4a35aec4f47120e1b.tar.bz2 regularization-57229985e3576db6a714d7e4a35aec4f47120e1b.tar.xz regularization-57229985e3576db6a714d7e4a35aec4f47120e1b.zip |
Merge pull request #124 from vais-ral/tests_nopillow
Dropping pillow dependency fot unittests
Diffstat (limited to 'demos')
-rw-r--r-- | demos/data/binary_save.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/demos/data/binary_save.py b/demos/data/binary_save.py new file mode 100644 index 0000000..06b5eb2 --- /dev/null +++ b/demos/data/binary_save.py @@ -0,0 +1,11 @@ +import numpy as np +outfile = open('test_imageLena.bin', 'wb') # Open a file for binary write +outfile.write(Im) # Write it +outfile.flush() # Optional but a good idea +outfile.close() +#%% +# Define width and height +w, h = 256, 256 +# Read file using numpy "fromfile()" +with open('my_file.bin', mode='rb') as f: + d = np.fromfile(f,dtype=np.float32,count=w*h).reshape(h,w)
\ No newline at end of file |