Tensorflow

Transforms

class ToTensorflow(always_apply=True, p=1.0)[source]

Bases: BasicTransform

Convert image and mask to Tensorflow.Tensor. The numpy HWDC image is converted to Tensorflow HWDC tensor. If the image is in HWD format (grayscale image), it will be converted to Tensorflow HWDC tensor.

Parameters:
  • always_apply (bool) – Indicates whether this transformation should be always applied. Default: True.

  • p (float) – Probability of applying the transform. Default: 1.0.

apply(img: ndarray, **params) tf.tensor[source]
apply_to_mask(mask: ndarray, **params) tf.tensor[source]
apply_to_masks(masks: List[ndarray], **params) tf.tensor[source]
get_params_dependent_on_targets(params: Dict[str, Any]) Dict[str, Any][source]
get_transform_init_args_names() Tuple[str, ...][source]
property targets: Dict[str, Callable]