File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def _cache_images(self):
9999 f"there is no guarantee that the remaining memory space is sufficient"
100100 )
101101
102- if self .cache and self . imgs is None :
102+ if self .imgs is None :
103103 if self .cache_type == 'ram' :
104104 self .imgs = [None ] * self .num_imgs
105105 logger .info ("You are using cached images in RAM to accelerate training!" )
@@ -224,9 +224,9 @@ def pull_item(self, index):
224224 id_ = self .ids [index ]
225225 label , origin_image_size , _ , filename = self .annotations [index ]
226226
227- if self .cache_type == 'ram' :
227+ if self .cache and self . cache_type == 'ram' :
228228 img = self .imgs [index ]
229- elif self .cache_type == 'disk' :
229+ elif self .cache and self . cache_type == 'disk' :
230230 img = np .load (os .path .join (self .cache_dir , f"{ filename .split ('.' )[0 ]} .npy" ))
231231 else :
232232 img = self .load_resized_img (index )
You can’t perform that action at this time.
0 commit comments