Skip to content

Commit

Permalink
Add load dict function
Browse files Browse the repository at this point in the history
  • Loading branch information
swz30 authored Apr 7, 2020
1 parent 7d8797d commit 229fdcb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def is_png_file(filename):
def is_pkl_file(filename):
return any(filename.endswith(extension) for extension in [".pkl"])

def load_dict(filename_):
with open(filename_, 'rb') as f:
ret_dict = pickle.load(f)
return ret_dict

def load_pkl(filename_):
with open(filename_, 'rb') as f:
Expand Down

0 comments on commit 229fdcb

Please sign in to comment.