Efficient way to generate images of Segmentation and Detection image predictions

Suppose I have a trained segmentation/detection learner ready to make prediction on an entirely DatasetType.Test. Is there a (efficient) way to output the predictions with the predicted segmentation masks / bboxes from the test images?
Thanks!