visualize_concept_model
- hybrid_learning.concepts.analysis.visualization.visualize_concept_model(handle, max_num_samples=10, label_templ=None, axes=None, start_idx=0, save_as=None, transform=None)[source]
Visualize predictions of a segmentation concept model on test samples. Visualization results will be shown using
matplotlib.pyplot.imshow()
functionality and are optionally saved to a file.- Parameters
handle (ConceptDetection2DTrainTestHandle) – the train/test handle for the concept model to evaluate (holds model and data)
start_idx (int) – relevant if axes is given; the row index to start filling axes
axes (Optional[Axes]) – optionally, one can specify an
matplotlib.axes.Axes
object to work on; generated by defaultmax_num_samples (int) – how many test samples to visualize
label_templ (Optional[str]) – template that is formatted and printed along with each sample; must contain a placeholder for the image ID as
'{}'
save_as (Optional[str]) – .png file path to store the image file in using
matplotlib.pyplot.savefig()
; not saved ifNone
transform (Optional[Callable[[Any, Any], Tuple[Tensor, Tensor]]]) – a transformation to be applied to the tuple of model output and ground truth mask before mask visualization