def validation_step()

in src/sagemaker_defect_detection/detector.py [0:0]


    def validation_step(self, batch, batch_idx):
        images, targets, _ = batch
        if self.train_rpn:  # rpn doesn't compute loss for val
            return {}
        elif self.train_roi:
            # TODO: scores are predictions scores, not a metric! iou? + acc?
            return {}
        else:
            images = list(image for image in images)
            targets = [{k: v for k, v in t.items()} for t in targets]
            outputs = self(images, targets=targets)
            ret = {target["image_id"].item(): output for target, output in zip(targets, outputs)}
            self.coco_evaluator.update(ret)
            return {}