neg_pixel_prop
- hybrid_learning.datasets.data_visualization.neg_pixel_prop(data, max_num_samples=10, show_progress_bar=False)[source]
Collect the mean proportion of negative pixels in the binary segmentation mask data. The proportion is estimated from the first
max_num_samples
samples in the dataset. Set the value toNone
to take into account all samples in the dataset.- Parameters
data – a
typing.Sequence
that yields tuples of input (arbitrary) and masks (astorch.Tensor
).max_num_samples (Optional[int]) – the maximum number of samples to take into account for the estimation
show_progress_bar (bool) – whether to show a progress bar for loading the masks
- Returns
the proportion of negative pixels in all (resp. the first
num_samples
) binary segmentation masks contained in the given data- Return type