INNER CODE UNIT · Python

normalize

BrokenSource/DepthFlow · depthflow/estimators/__init__.py:64

    def normalize(
        array: np.ndarray,
        dtype: DTypeLike = np.float32,
        lerp: DTypeLike = np.float64,
        min: float | None = None,
        max: float | None = None,
    ) -> np.ndarray:

        # Get the dtype information
        if np.issubdtype(dtype, np.integer):
            info = np.iinfo(dtype) # type: ignore
        else:
            info = np.finfo(dtype) # type: ignore

        # Optionally override target dtype min and max
        min = (info.min if (min is None) else min) # type: ignore
        max = (info.max if (max is None) else max) # type: ignore

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…