Skip to content

HoverNetTransform

Bases: OnlyInstMapTransform

available_keys property

available_keys: set[str]

Returns set of available keys.

__init__

__init__(deduplicate: bool = True) -> None

Generate horizontal and vertical gradients from a label mask.

https://www.sciencedirect.com/science/article/pii/S1361841519301045

Parameters:

Name Type Description Default
deduplicate bool, default=True

Whether to fix duplicate values in the mask before transforming. This adds overhead, so use only if you know that the mask has duplicates.

True

__call__

__call__(inst: ndarray, **kwargs) -> np.ndarray

Fix duplicate values and generate gradients.

Parameters:

Name Type Description Default
inst ndarray

Instance labelled mask. Shape (H, W).

required

Returns:

Type Description
ndarray

np.ndarray: Horizontal and vertical gradients of objects. Shape: (2, H, W). Dtype: float64.