File tree 1 file changed +4
-6
lines changed
mmf/datasets/databases/readers
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -202,16 +202,14 @@ def _load(self, image_file_path):
202
202
image_id = int (split .split ("_" )[- 1 ])
203
203
# Try fetching to see if it actually exists otherwise fall back to
204
204
# default
205
- _ = self .image_id_indices [image_id ]
205
+ img_id_idx = self .image_id_indices [str ( image_id ). encode () ]
206
206
except (ValueError , KeyError ):
207
207
# The image id is complex or involves folder, use it directly
208
- image_id = split
209
- image_id = str ( image_id ). encode ()
208
+ image_id = str ( split ). encode ()
209
+ img_id_idx = self . image_id_indices [ image_id ]
210
210
211
211
with self .env .begin (write = False , buffers = True ) as txn :
212
- image_info = pickle .loads (
213
- txn .get (self .image_ids [self .image_id_indices [image_id ]])
214
- )
212
+ image_info = pickle .loads (txn .get (self .image_ids [img_id_idx ]))
215
213
216
214
return image_info
217
215
You can’t perform that action at this time.
0 commit comments