From 229fdcb946994306dffd35f8cd08cc2a50ddecc5 Mon Sep 17 00:00:00 2001 From: Syed Waqas Zamir <41057533+swz30@users.noreply.github.com> Date: Tue, 7 Apr 2020 20:12:40 +0400 Subject: [PATCH] Add load dict function --- utils/image_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/image_utils.py b/utils/image_utils.py index 6c0e1fa..e0df7a3 100644 --- a/utils/image_utils.py +++ b/utils/image_utils.py @@ -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: