Exemplo n.º 1
0
 def eval_loader(self):
     eval_data = Coco(
         image_dir=self.eval_image_dir,
         ann_file=self.eval_annotations,
         preprocess=self._eval_preprocess(),
         annotation_filter=self.eval_annotation_filter,
         min_kp_anns=self.min_kp_anns if self.eval_annotation_filter else 0,
         category_ids=[1] if self.eval_annotation_filter else [],
     )
     return torch.utils.data.DataLoader(eval_data,
                                        batch_size=self.batch_size,
                                        shuffle=False,
                                        pin_memory=self.pin_memory,
                                        num_workers=self.loader_workers,
                                        drop_last=False,
                                        collate_fn=collate_images_anns_meta)
Exemplo n.º 2
0
 def val_loader(self):
     val_data = Coco(
         image_dir=self.val_image_dir,
         ann_file=self.val_annotations,
         preprocess=self._preprocess(),
         annotation_filter=True,
         min_kp_anns=self.min_kp_anns,
         category_ids=[1],
     )
     return torch.utils.data.DataLoader(
         val_data,
         batch_size=self.batch_size,
         shuffle=False,
         pin_memory=self.pin_memory,
         num_workers=self.loader_workers,
         drop_last=True,
         collate_fn=openpifpaf.datasets.collate_images_targets_meta)
Exemplo n.º 3
0
 def train_loader(self):
     train_data = Coco(
         image_dir=self.train_image_dir,
         ann_file=self.train_annotations,
         preprocess=self._preprocess(),
         annotation_filter=True,
         min_kp_anns=self.min_kp_anns,
         category_ids=[1],
     )
     return torch.utils.data.DataLoader(
         train_data,
         batch_size=self.batch_size,
         shuffle=not self.debug and self.augmentation,
         pin_memory=self.pin_memory,
         num_workers=self.loader_workers,
         drop_last=True,
         collate_fn=collate_images_targets_meta)