130 img_key, pid, camid = self.
img_items[index]
132 with self.
env.begin(write=
False)
as txn:
133 buf = txn.get(img_key.encode(
'ascii'))
135 img_flat = np.frombuffer(buf, dtype=np.uint8)
137 im = cv2.imdecode(img_flat, cv2.IMREAD_COLOR)
138 im = Image.fromarray(im[:, :, ::-1])
143 return {
'images': im,
'targets': pid,
144 'camids': 0,
'img_paths': img_key}