def __getitem__(self, index): if index < self.num_samples0: the_db = self.db0[index] else: the_db = self.db1[self.idx[index - self.num_samples0]] img_patch, label, label_weight = \ get_single_patch_sample(the_db['image'], the_db['center_x'], the_db['center_y'], the_db['width'], the_db['height'], the_db['joints_3d'].copy(), the_db['joints_3d_vis'].copy(), self.db1[0]['flip_pairs'].copy(), self.db1[0]['parent_ids'].copy(), self.patch_width, self.patch_height, self.rect_3d_width, self.rect_3d_height, self.mean, self.std, self.do_augment, self.aug_config, self.label_func, self.label_config, depth_in_image=True) self.count = self.count + 1 if self.count >= self.db_length: self.count = 0 self.idx = np.arange(self.num_samples1) np.random.shuffle(self.idx) return img_patch.astype(np.float32), label.astype( np.float32), label_weight.astype(np.float32)
def __getitem__(self, index): the_db = self.db[index] windows = [the_db['left_top'].copy(), the_db['left_bottom'].copy(), the_db['right_bottom'].copy(), the_db['right_top'].copy()] if self.useCenterNet: windows += [the_db['center'].copy()] img_patch, label, gt_loc = get_single_patch_sample(the_db['image'], windows, self.flip_pair, self.patch_width, self.patch_height, self.mean, self.std, self.do_augment, self.aug_config, self.label_func, self.loss_config) return img_patch.astype(np.float32), label.astype(np.float32), gt_loc.astype(np.float32)
def __getitem__(self, index): the_db = self.db[index] img_patch, label, label_weight = \ get_single_patch_sample(the_db['image'], the_db['center_x'], the_db['center_y'], the_db['width'], the_db['height'], the_db['joints_3d'].copy(), the_db['joints_3d_vis'].copy(), the_db['flip_pairs'].copy(), the_db['parent_ids'].copy(), self.patch_width, self.patch_height, self.rect_3d_width, self.rect_3d_height, self.mean, self.std, self.do_augment, self.aug_config, self.label_func, self.label_config) return img_patch.astype(np.float32), label.astype( np.float32), label_weight.astype(np.float32)