| 39 | np.random.shuffle(self.pkl_list) |
| 40 | |
| 41 | def work(self, idx): |
| 42 | pkl_path = self.pkl_list[idx] |
| 43 | label = pickle.load(open(pkl_path, 'rb')) |
| 44 | |
| 45 | img_path = pkl_path.replace('.dat', '.png') |
| 46 | ''' |
| 47 | img = cv2.imread(img_path, cv2.IMREAD_UNCHANGED) |
| 48 | img[np.where(img[:,:,3]==0)] = 255 |
| 49 | img = cv2.resize(img, (224,224)) |
| 50 | img = img[:,:,:3]/255. |
| 51 | ''' |
| 52 | img = io.imread(img_path) |
| 53 | img[np.where(img[:,:,3]==0)] = 255 |
| 54 | img = transform.resize(img, (224,224)) |
| 55 | img = img[:,:,:3].astype('float32') |
| 56 | |
| 57 | return img, label, pkl_path.split('/')[-1] |
| 58 | |
| 59 | def run(self): |
| 60 | while self.index < 90000000 and not self.stopped: |