From 89da853a4fd873ae1701a54a1e7c25e6dde5644b Mon Sep 17 00:00:00 2001 From: MrForExample <62230687+MrForExample@users.noreply.github.com> Date: Sun, 21 Jan 2024 18:11:48 +0100 Subject: [PATCH] Delete unnecessary Scripts --- src/pipelines/__init__.py | 0 src/pipelines/context.py | 2 -- src/pipelines/utils.py | 29 ----------------------------- 3 files changed, 31 deletions(-) delete mode 100644 src/pipelines/__init__.py delete mode 100644 src/pipelines/context.py delete mode 100644 src/pipelines/utils.py diff --git a/src/pipelines/__init__.py b/src/pipelines/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/pipelines/context.py b/src/pipelines/context.py deleted file mode 100644 index 139597f..0000000 --- a/src/pipelines/context.py +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/pipelines/utils.py b/src/pipelines/utils.py deleted file mode 100644 index 3cd5076..0000000 --- a/src/pipelines/utils.py +++ /dev/null @@ -1,29 +0,0 @@ -import torch - -tensor_interpolation = None - - -def get_tensor_interpolation_method(): - return tensor_interpolation - - -def set_tensor_interpolation_method(is_slerp): - global tensor_interpolation - tensor_interpolation = slerp if is_slerp else linear - - -def linear(v1, v2, t): - return (1.0 - t) * v1 + t * v2 - - -def slerp( - v0: torch.Tensor, v1: torch.Tensor, t: float, DOT_THRESHOLD: float = 0.9995 -) -> torch.Tensor: - u0 = v0 / v0.norm() - u1 = v1 / v1.norm() - dot = (u0 * u1).sum() - if dot.abs() > DOT_THRESHOLD: - # logger.info(f'warning: v0 and v1 close to parallel, using linear interpolation instead.') - return (1.0 - t) * v0 + t * v1 - omega = dot.acos() - return (((1.0 - t) * omega).sin() * v0 + (t * omega).sin() * v1) / omega.sin()