Skip to content

Instantly share code, notes, and snippets.

View aminzabardast's full-sized avatar

Amin Zabardast aminzabardast

View GitHub Profile
@aminzabardast
aminzabardast / IO.py
Created July 24, 2019 22:42
IO library to read and write images, flows, and disparities
import os
import re
import numpy as np
import uuid
from scipy import misc
import numpy as np
from PIL import Image
import sys
import numpy as np
import re
import sys
'''
Read a PFM file into a Numpy array. Note that it will have
a shape of H x W, not W x H. Returns a tuple containing the
loaded image and the scale factor from the file.
'''
def read_pfm(file):