|
|
@ -179,8 +179,9 @@ class SegmentationValidator(DetectionValidator):
|
|
|
|
|
|
|
|
|
|
|
|
def plot_predictions(self, batch, preds, ni):
|
|
|
|
def plot_predictions(self, batch, preds, ni):
|
|
|
|
"""Plots batch predictions with masks and bounding boxes."""
|
|
|
|
"""Plots batch predictions with masks and bounding boxes."""
|
|
|
|
plot_images(batch['img'],
|
|
|
|
plot_images(
|
|
|
|
*output_to_target(preds[0], max_det=15),
|
|
|
|
batch['img'],
|
|
|
|
|
|
|
|
*output_to_target(preds[0], max_det=15), # not set to self.args.max_det due to slow plotting speed
|
|
|
|
torch.cat(self.plot_masks, dim=0) if len(self.plot_masks) else self.plot_masks,
|
|
|
|
torch.cat(self.plot_masks, dim=0) if len(self.plot_masks) else self.plot_masks,
|
|
|
|
paths=batch['im_file'],
|
|
|
|
paths=batch['im_file'],
|
|
|
|
fname=self.save_dir / f'val_batch{ni}_pred.jpg',
|
|
|
|
fname=self.save_dir / f'val_batch{ni}_pred.jpg',
|
|
|
|