code: def load_bin(path, image_size):
      if six.PY2:
          bins, issame_list = pickle.load(open(path, "rb"))
      else:
          bins, issame_list = pickle.load(
              open(path, "rb"), encoding="bytes"
          )
      data_list = []
      for flip in [0, 1]:
          data = np.empty(
              (len(issame_list) * 2, 3, image_size[0], image_size[1])
          )
          data_list.append(data)
      for i in range(len(issame_list) * 2):
          _bin = bins[i]
          if six.PY2:
              if not isinstance(_bin, six.string_types):
                  _bin = _bin.tostring()
              img_ori = Image.open(StringIO(_bin))
          else:
              img_ori = Image.open(BytesIO(_bin))
          for flip in [0, 1]:
              img = img_ori.copy()
              if flip == 1:
                  img = img.transpose(Image.FLIP_LEFT_RIGHT)
              if img.mode != "RGB":
                  img = img.convert("RGB")
              img = np.array(img).astype("float32").transpose((2, 0, 1))
              img = (img - 127.5) * 0.00784313725
              data_list[flip][i][:] = img
          if i % 1000 == 0:
              print("loading bin", i)
      print(data_list[0].shape)
      return data_list, issame_list
  
imports: import pickle
  import paddle
  import os
  import cv2
  import six
  import random
  import paddle
  import numpy
  import logging
  from PIL import Image
  from io import BytesIO
  from datasets.kv_helper import read_img_from_bin
label_desc: Use image node_id 2 for calling a global function with example usage: load_bin(path, image_size) and returns: data_list,  issame_list